久久久久久久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 中以表格形式顯示?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

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

                  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)  
                  

                  結(jié)果如下所示:

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

                  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.)

                  下圖幫助你理解,

                  所以我希望結(jié)果采用以下格式.我想不出辦法,如果你能回答這個(gè)問(wèn)題,請(qǐng)這樣做,那將是一個(gè)非常大的幫助!謝謝.

                  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 設(shè)置為 False 并將 > 字符添加到每個(gè)統(tǒng)計(jì)信息中.

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

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

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

                  相關(guān)文檔推薦

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

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

                          • 主站蜘蛛池模板: 欧美久久久久久久久 | 婷婷久久久 | 一区二区三区视频在线播放 | 久久久久久久久久久国产 | 中文字幕在线观看一区二区三区 | 成人影片在线 | 四虎久久久 | 精品日韩一区二区三区 | 日韩一区二区中文字幕 | 亚洲视频在线播放 | 91成人小视频 | 中文字幕在线看片 | 日日爽夜夜爽 | 日韩黄色视屏 | 免费一级a毛片 | 亚洲精品黄 | 日韩一区二区在线观看视频 | 免费看片黄色 | 午夜大片 | 中文字幕在线一区 | 在线免费观看av片 | 成年人午夜视频 | 福利三区 | 天天视频黄 | 午夜网 | 在线观看一区 | 国产一区二区视频在线 | 91丨九色丨蝌蚪丨丝袜 | 性一交一乱一伧老太 | 精品aaa| 欧美国产日韩一区二区 | a级片免费在线观看 | 极品av在线| 久久久国产精品人人片 | 亚洲成a人 | 国产成人在线观看免费网站 | 五月婷婷 | 视频一区在线观看 | 欧美一区二区三区视频 | www.久久精品| 午夜婷婷|