pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="0ague2q" 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>

        如何使數據在 discord.py 中以表格形式顯示?

        How to make data to be shown in tabular form in discord.py?(如何使數據在 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="o2aes0q" id='rQgls'><tfoot id='rQgls'></tfoot><dl id='rQgls'><fieldset id='rQgls'></fieldset></dl></div>
                2. 本文介紹了如何使數據在 discord.py 中以表格形式顯示?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

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

                  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)  
                  

                  結果如下所示:

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

                  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)
                  

                  代碼將輸出如下內容:

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

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

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

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

                  相關文檔推薦

                  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="ikamkww" 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'>

                          • 主站蜘蛛池模板: 振动时效_振动时效仪_超声波冲击设备-济南驰奥机电设备有限公司 北京宣传片拍摄_产品宣传片拍摄_宣传片制作公司-现像传媒 | 深圳希玛林顺潮眼科医院(官网)│深圳眼科医院│医保定点│香港希玛林顺潮眼科中心连锁品牌 | TPE_TPE热塑性弹性体_TPE原料价格_TPE材料厂家-惠州市中塑王塑胶制品公司- 中塑王塑胶制品有限公司 | 南京PVC快速门厂家南京快速卷帘门_南京pvc快速门_世界500强企业国内供应商_南京美高门业 | 红外光谱仪维修_二手红外光谱仪_红外压片机_红外附件-天津博精仪器 | 香蕉筛|直线|等厚|弧形|振动筛|香蕉筛厂家-洛阳隆中重工 | 珠光砂保温板-一体化保温板-有釉面发泡陶瓷保温板-杭州一体化建筑材料 | 深圳湾1号房价_深圳湾1号二手房源| 北京律师咨询_知名专业北京律师事务所_免费法律咨询 | 北京自然绿环境科技发展有限公司专业生产【洗车机_加油站洗车机-全自动洗车机】 | 立式_复合式_壁挂式智能化电伴热洗眼器-上海达傲洗眼器生产厂家 理化生实验室设备,吊装实验室设备,顶装实验室设备,实验室成套设备厂家,校园功能室设备,智慧书法教室方案 - 东莞市惠森教学设备有限公司 | 减速机电机一体机_带电机减速器一套_德国BOSERL电动机与减速箱生产厂家 | 南京技嘉环保科技有限公司-杀菌除臭剂|污水|垃圾|厕所|橡胶厂|化工厂|铸造厂除臭剂 | 「安徽双凯」自动售货机-无人售货机-成人用品-自动饮料食品零食售货机 | 水厂污泥地磅|污泥处理地磅厂家|地磅无人值守称重系统升级改造|地磅自动称重系统维修-河南成辉电子科技有限公司 | 钢制暖气片散热器_天津钢制暖气片_卡麦罗散热器厂家 | 集菌仪厂家_全封闭_封闭式_智能智能集菌仪厂家-上海郓曹 | 智能电表|预付费ic卡水电表|nb智能无线远传载波电表-福建百悦信息科技有限公司 | 烘箱-工业烘箱-工业电炉-实验室干燥箱 - 苏州华洁烘箱制造有限公司 | 照相馆预约系统,微信公众号摄影门店系统,影楼管理软件-盟百网络 | 智能型高压核相仪-自动开口闪点测试仪-QJ41A电雷管测试仪|上海妙定 | 头条搜索极速版下载安装免费新版,头条搜索极速版邀请码怎么填写? - 欧远全 | 上海诺狮景观规划设计有限公司 | 下水道疏通_管道疏通_马桶疏通_附近疏通电话- 立刻通 | 河南卓美创业科技有限公司-河南卓美防雷公司-防雷接地-防雷工程-重庆避雷针-避雷器-防雷检测-避雷带-避雷针-避雷塔、机房防雷、古建筑防雷等-山西防雷公司 | 接地电阻测试仪[厂家直销]_电缆故障测试仪[精准定位]_耐压测试仪-武汉南电至诚电力设备 | 德国UST优斯特氢气检漏仪-德国舒赐乙烷检测仪-北京泽钏 | 台式恒温摇床价格_大容量恒温摇床厂家-上海量壹科学仪器有限公司 | 小港信息港-鹤壁信息港 鹤壁老百姓便民生活信息网站 | 右手官网|右手工业设计|外观设计公司|工业设计公司|产品创新设计|医疗产品结构设计|EMC产品结构设计 | 桁架机器人_桁架机械手_上下料机械手_数控车床机械手-苏州清智科技装备制造有限公司 | 2025世界机器人大会_IC China_半导体展_集成电路博览会_智能制造展览网 | 防腐储罐_塑料储罐_PE储罐厂家_淄博富邦滚塑防腐设备科技有限公司 | 武汉画册印刷厂家-企业画册印刷-画册设计印刷制作-宣传画册印刷公司 - 武汉泽雅印刷厂 | 济南货架定做_仓储货架生产厂_重型货架厂_仓库货架批发_济南启力仓储设备有限公司 | 挖掘机挖斗和铲斗生产厂家选择徐州崛起机械制造有限公司 | 好看的韩国漫画_韩漫在线免费阅读-汗汗漫画 | 山东锐智科电检测仪器有限公司_超声波测厚仪,涂层测厚仪,里氏硬度计,电火花检漏仪,地下管线探测仪 | 上海办公室装修公司_办公室设计_直营办公装修-羚志悦装 | 包装设计公司,产品包装设计|包装制作,包装盒定制厂家-汇包装【官方网站】 | 政府园区专业委托招商平台_助力企业选址项目快速落地_东方龙商务集团 |