久久久久久久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'>

                          • 主站蜘蛛池模板: 天天射影院| 国产高清视频 | 国产精品久久久久久238 | 福利av在线 | 九九亚洲 | 亚洲精品在线看 | 久久精品一区二区三区四区 | 国产成人一区二区三区电影 | 日本不卡免费新一二三区 | 99久热| 日本一级淫片免费啪啪3 | 国产三级精品三级在线观看四季网 | 日本五月婷婷 | 四虎影院新网址 | 久久久婷婷| 福利视频亚洲 | chinese中国真实乱对白 | 日韩欧美在| 久久一区二区三区四区 | 中文字幕第一页在线 | 福利一区在线观看 | 日韩精品一二三 | 亚洲精品白浆高清久久久久久 | 天天操天天干天天曰 | 久久伊人青青草 | 亚洲一区精品在线 | 99亚洲精品 | 午夜亚洲 | 久久久久久高潮国产精品视 | 久久男人| 午夜色播 | 三级免费毛片 | 国产精品久久久久一区二区三区 | 亚洲欧美一区二区三区国产精品 | 国产免费一区二区三区免费视频 | 精品国产欧美一区二区 | 亚洲精品久久久久久首妖 | 欧美精品第一区 | 国产精品久久久精品 | 久久r免费视频 | 亚洲成人99|