久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='smliB'></small><noframes id='smliB'>

        <bdo id='smliB'></bdo><ul id='smliB'></ul>
        <tfoot id='smliB'></tfoot>
        <i id='smliB'><tr id='smliB'><dt id='smliB'><q id='smliB'><span id='smliB'><b id='smliB'><form id='smliB'><ins id='smliB'></ins><ul id='smliB'></ul><sub id='smliB'></sub></form><legend id='smliB'></legend><bdo id='smliB'><pre id='smliB'><center id='smliB'></center></pre></bdo></b><th id='smliB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='smliB'><tfoot id='smliB'></tfoot><dl id='smliB'><fieldset id='smliB'></fieldset></dl></div>
        <legend id='smliB'><style id='smliB'><dir id='smliB'><q id='smliB'></q></dir></style></legend>

        如何使數(shù)據(jù)在 discord.py 中以表格形式顯示?

        How to make data to be shown in tabular form in discord.py?(如何使數(shù)據(jù)在 discord.py 中以表格形式顯示?)

        <tfoot id='rQgls'></tfoot><legend id='rQgls'><style id='rQgls'><dir id='rQgls'><q id='rQgls'></q></dir></style></legend>

        • <bdo id='rQgls'></bdo><ul id='rQgls'></ul>

            <small id='rQgls'></small><noframes id='rQgls'>

                <tbody id='rQgls'></tbody>
                1. <i id='rQgls'><tr id='rQgls'><dt id='rQgls'><q id='rQgls'><span id='rQgls'><b id='rQgls'><form id='rQgls'><ins id='rQgls'></ins><ul id='rQgls'></ul><sub id='rQgls'></sub></form><legend id='rQgls'></legend><bdo id='rQgls'><pre id='rQgls'><center id='rQgls'></center></pre></bdo></b><th id='rQgls'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rQgls'><tfoot id='rQgls'></tfoot><dl id='rQgls'><fieldset id='rQgls'></fieldset></dl></div>
                2. 本文介紹了如何使數(shù)據(jù)在 discord.py 中以表格形式顯示?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  您好,我正在創(chuàng)建一個制作積分表/排行榜的機器人,下面是非常好用的代碼.

                  Hi I am creating a bot that makes points table/leaderboard , below is the code which works really nice.

                  def check(ctx):
                      return lambda m: m.author == ctx.author and m.channel == ctx.channel
                  
                  
                  async def get_input_of_type(func, ctx):
                      while True:
                          try:
                              msg = await bot.wait_for('message', check=check(ctx))
                              return func(msg.content)
                          except ValueError:
                              continue
                  
                  @bot.command()
                  async def start(ctx):
                      await ctx.send("How many total teams are there?")
                      t = await get_input_of_type(int, ctx)
                      embed = discord.Embed(title=f"__**{ctx.guild.name} Results:**__", color=0x03f8fc,timestamp= ctx.message.created_at)
                      
                      lst = []
                      
                      for i in range(t):
                          await ctx.send(f"Enter team {i+1} name :")
                          teamname = await get_input_of_type(str, ctx)
                          await ctx.send("How many kills did they get?")
                          firstnum = await get_input_of_type(int, ctx)
                          await ctx.send("How much Position points did they score?")
                          secondnum = await get_input_of_type(int, ctx)
                          lst.append((teamname, firstnum, secondnum))  # append 
                          
                      lstSorted = sorted(lst, key = lambda x: int(x[1]) + int(x[2],),reverse=True) # sort   
                      for teamname, firstnum, secondnum in lstSorted:  # process embed
                          embed.add_field(name=f'**{teamname}**', value=f'Kills: {firstnum}
                  Position Pt: {secondnum}
                  Total Pt: {firstnum+secondnum}',inline=True)
                  
                      await ctx.send(embed=embed)  
                  

                  結果如下所示:

                  但我想知道,我可以做些什么來獲得表格形式的結果,例如團隊名稱、位置點數(shù)、總分、連續(xù)寫的擊殺分以及打印在它們下面的結果(我真的不知道,如果這讓你明白我想說什么.)

                  But I want to know, can I do something to get the result in tabular form like The Team Name , positions points , total pts, kill pts written in a row and the results printed below them (I really don't if that made you understand what I am trying to say.)

                  下圖幫助你理解,

                  所以我希望結果采用以下格式.我想不出辦法,如果你能回答這個問題,請這樣做,那將是一個非常大的幫助!謝謝.

                  So I want the result to be in following format. I can't think of a way doing it , if you can answer this please do so, That would be a very great help! Thanks.

                  推薦答案

                  這可能是你得到的最接近的:

                  This is probably the closest you will get:

                  embed.add_field(name=f'**{teamname}**', value=f'> Kills: {firstnum}
                  > Position Pt: {secondnum}
                  > Total Pt: {firstnum+secondnum}',inline=False)
                  

                  代碼將輸出如下內(nèi)容:

                  我已將 inline 設置為 False 并將 > 字符添加到每個統(tǒng)計信息中.

                  I've set inline to False and added the > character to each of statistics.

                  這篇關于如何使數(shù)據(jù)在 discord.py 中以表格形式顯示?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)

                    <tfoot id='GQayI'></tfoot>
                      <bdo id='GQayI'></bdo><ul id='GQayI'></ul>
                      <legend id='GQayI'><style id='GQayI'><dir id='GQayI'><q id='GQayI'></q></dir></style></legend>

                      <i id='GQayI'><tr id='GQayI'><dt id='GQayI'><q id='GQayI'><span id='GQayI'><b id='GQayI'><form id='GQayI'><ins id='GQayI'></ins><ul id='GQayI'></ul><sub id='GQayI'></sub></form><legend id='GQayI'></legend><bdo id='GQayI'><pre id='GQayI'><center id='GQayI'></center></pre></bdo></b><th id='GQayI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='GQayI'><tfoot id='GQayI'></tfoot><dl id='GQayI'><fieldset id='GQayI'></fieldset></dl></div>

                        <tbody id='GQayI'></tbody>
                      • <small id='GQayI'></small><noframes id='GQayI'>

                          • 主站蜘蛛池模板: 国产精品揄拍一区二区 | 欧美一区二区免费视频 | 伊人伊成久久人综合网站 | 亚洲午夜av | 中文字幕免费视频 | 翔田千里一区二区 | 久久精品国产99国产精品 | 国产成人精品久久 | 国内毛片毛片毛片毛片 | 天天射影院 | 成人免费视频网站在线看 | 亚洲高清在线 | av中文字幕在线播放 | 最新中文在线视频 | 亚洲一区二区三区在线播放 | 国产精品一区在线观看 | 久久久久国产一区二区三区 | 另类 综合 日韩 欧美 亚洲 | 亚洲一区精品视频 | 午夜视频一区二区三区 | 天天曰夜夜操 | 国产乱码一区 | h视频在线免费观看 | 蜜桃视频麻豆 | 国产三区精品 | 日一区二区 | 日本精品一区 | 97国产成人 | 精品欧美一区二区三区免费观看 | 国产日韩欧美精品一区二区三区 | 国产精品久久久久久久久久久久午夜片 | 免费成人毛片 | 亚洲精品在线免费 | 99精品国产一区二区青青牛奶 | 在线电影日韩 | 四虎影视一区二区 | 1区2区3区视频 | 日韩午夜精品 | 久久久久久999 | 欧美视频一区二区三区 | 欧美国产视频 |