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

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

    1. <tfoot id='hVDlz'></tfoot>

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

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

      1. 我的 TEMPMUTE 命令出現一定錯誤

        I#39;m getting a certain error on my TEMPMUTE command(我的 TEMPMUTE 命令出現一定錯誤)

          <tfoot id='1qgl6'></tfoot>

          <small id='1qgl6'></small><noframes id='1qgl6'>

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

              <bdo id='1qgl6'></bdo><ul id='1qgl6'></ul>
              <legend id='1qgl6'><style id='1qgl6'><dir id='1qgl6'><q id='1qgl6'></q></dir></style></legend>

                1. 本文介紹了我的 TEMPMUTE 命令出現一定錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我已經制作了一個臨時代碼,或者我們可以說我在 stackoverflow 上找到了一個.我復制了代碼,但它似乎不起作用.如果你們中的任何人現在可以幫助我,謝謝!代碼是;

                  I have made a tempmute code or we can say I found one on stackoverflow. I copied the code but it doesn't seem to work. If anyone of you now and can help me thanks! The code is;

                  @commands.has_permissions(kick_members=True)
                  async def tempmute(ctx, member: discord.Member, time=0, reason=None):
                      if not member or time == 0:
                          return
                      elif reason == None:
                          reason = 'No reason'
                      try:
                          if time_list[2] == "s":
                              time_in_s = int(time_list[1])
                          if time_list[2] == "min":
                              time_in_s = int(time_list[1]) * 60
                          if time_list[2] == "h":
                              time_in_s = int(time_list[1]) * 60 * 60
                          if time_list[2] == "d":
                              time_in_s = int(time_list[1]) * 60 * 60 * 60
                      except:
                          time_in_s = 0
                   
                      tempmuteembed = discord.Embed(colour=discord.Colour.from_rgb(0, 255, 0))
                      tempmuteembed.set_author(icon_url=member.avatar_url, name=f'{member} has been tempmuted!')
                      tempmuteembed.set_footer(text=f"{ctx.guild.name}  ?  {datetime.strftime(datetime.now(), '%d.%m.%Y at %I:%M %p')}")
                      tempmuteembed.add_field(name=f'ID:', value=f'{member.id}', inline=False)
                      tempmuteembed.add_field(name='Reason:', value=f"{reason}")
                      tempmuteembed.add_field(name='Duration:', value=f"{time}")
                      tempmuteembed.add_field(name=f'By:', value=f'{ctx.author.name}#{ctx.author.discriminator}', inline=False)
                      await ctx.send(embed=tempmuteembed)
                  
                   
                      guild = ctx.guild
                      for role in guild.roles:
                          if role.name == 'Muted':
                              await member.add_roles(role)
                              await ctx.send(embed=tempmuteembed)
                              await asyncio.sleep(time_in_s)
                              await member.remove_roles(role)
                              return
                  

                  我得到的錯誤如下;

                  discord.ext.commands.errors.BadArgument: Converting to "int" failed for parameter "time".
                  

                  推薦答案

                  這是因為 CommandConverters 在其參數上運行.由于 time 默認為 0,其類型為 int,因此庫嘗試將 time 轉換為 >int.但是,如果您提供像 10m 這樣的單位后綴,則此轉換將失敗,因為 int('10m') 失敗并出現 ValueError,其中輪到提出 BadArgument.

                  This is because Commands have Converters that are run on their arguments. Since time defaults to 0, which is of type int, the library tries to convert time to an int. However, this conversion will fail if you give a unit suffix like 10m, since int('10m') fails with a ValueError, which in turn raises BadArgument.

                  要解決這個問題,只需在 time 參數中添加適當的類型注釋:

                  To fix this, simply add a proper type annotation to your time parameter:

                  from typing import Union
                  async def tempmute(ctx, member: discord.Member, time: Union[int, str] = 0, reason=None):
                  

                  這篇關于我的 TEMPMUTE 命令出現一定錯誤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)
                  • <bdo id='SAfsR'></bdo><ul id='SAfsR'></ul>

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

                  • <legend id='SAfsR'><style id='SAfsR'><dir id='SAfsR'><q id='SAfsR'></q></dir></style></legend>

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

                            主站蜘蛛池模板: 久久综合伊人 | 欧美日韩免费一区二区三区 | 久久精品在线观看 | 黄色片在线免费观看 | 六月色婷婷 | 成人毛片100免费观看 | 亚洲精品三级 | 国产精品久久久999 成人在线国产 | 九九免费视频 | 中文字幕在线观看日本 | 影音先锋在线视频 | 亚洲不卡在线观看 | 国产一区在线播放 | 激情综合五月天 | 亚洲福利视频一区 | 色一区二区三区 | 亚洲精品成人网 | 男女搞黄网站 | 午夜精品在线 | 国产精品一区在线播放 | 国产一区二区三区视频在线 | 福利视频1000 | 黄色午夜 | 久久久亚洲精品视频 | 中文字幕永久免费 | 欧美成人精品欧美一级乱黄 | 欧美成人猛片aaaaaaa | 欧美日韩精品一区二区 | 免费一级毛片 | 在线成人免费 | 国产精品视频专区 | 性久久 | 午夜影院黄| 在线成人免费视频 | 一级片在线免费观看 | 精品理论片 | 五月天丁香 | 久久成人在线 | 三级黄色在线观看 | 欧美日韩亚洲综合 | 一级片网址 |