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

                            主站蜘蛛池模板: 精品自拍视频在线观看 | 夏同学福利网 | 日本国产高清 | 另类二区| 国产精品美女久久久av超清 | 综合精品在线 | 国产精品www| 91麻豆精品国产91久久久久久久久 | 日韩第一页 | 国产精品中文字幕在线播放 | 日日日视频 | 成人在线一区二区三区 | 91久久精品日日躁夜夜躁欧美 | 日韩欧美专区 | 国产精品欧美一区二区三区不卡 | 99精品一区二区三区 | 久久久久久国产 | 97精品久久| 欧美三级电影在线播放 | 久久黄视频 | 亚洲免费一区 | 欧美日韩成人影院 | 欧美一区二区三区在线看 | 成人久久一区 | 亚洲欧美中文日韩在线v日本 | 久久国内精品 | 亚洲欧美日韩精品久久亚洲区 | 成人在线不卡 | 国产毛片久久久 | 韩日中文字幕 | 精品日韩一区二区 | 日本黄色不卡视频 | 久久午夜视频 | 久久久一区二区 | 精品国产乱码久久久久久果冻传媒 | 成人av一区二区亚洲精 | 欧美成人精品在线观看 | 亚洲一区二区视频在线观看 | 亚洲一区二区精品 | 国产91在线播放 | 欧美 日韩 国产 成人 |