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

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

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

        如果用戶無權踢球,則無法讓 discord.py 引發錯誤

        Can#39;t get discord.py to raise an error if user doesn#39;t have permissions to kick(如果用戶無權踢球,則無法讓 discord.py 引發錯誤)
        <tfoot id='EwAai'></tfoot><legend id='EwAai'><style id='EwAai'><dir id='EwAai'><q id='EwAai'></q></dir></style></legend>
      2. <i id='EwAai'><tr id='EwAai'><dt id='EwAai'><q id='EwAai'><span id='EwAai'><b id='EwAai'><form id='EwAai'><ins id='EwAai'></ins><ul id='EwAai'></ul><sub id='EwAai'></sub></form><legend id='EwAai'></legend><bdo id='EwAai'><pre id='EwAai'><center id='EwAai'></center></pre></bdo></b><th id='EwAai'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='EwAai'><tfoot id='EwAai'></tfoot><dl id='EwAai'><fieldset id='EwAai'></fieldset></dl></div>
              <tbody id='EwAai'></tbody>

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

              • <bdo id='EwAai'></bdo><ul id='EwAai'></ul>
                  本文介紹了如果用戶無權踢球,則無法讓 discord.py 引發錯誤的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試制作一個可以踢人的快速機器人,如果它有權這樣做并且用戶有權這樣做,并且如果機器人沒有權限或用戶.但是我目前的解決方案似乎不起作用.這是處理它的代碼,當您擁有權限時,該代碼可以踢人,但如果機器人或用戶沒有權限,則不會引發錯誤.

                  I'm trying to make a quick bot that can kick people if it has the permission to do so and the user has the permission to do so as well as raise an error in chat if either the bot doesn't have the permissions or the user. However my current solution doesn't seem to be working. Here is the code that handles it, the code works to kick people when you have the permissions but doesn't raise an error if the bot or the user doesn't have the permissions.

                  @client.command(name = 'kick', pass_context = True)
                  @has_permissions(kick_members = True)
                  @bot_has_permissions(kick_members = True)
                  async def _kick(ctx, member : discord.Member, *, reason='No Reason Given'):
                      await member.kick(reason = reason)
                      await ctx.send(f'{member} was kicked for {reason}')
                  
                  
                  @_kick.error
                  async def kick_error(error, ctx):
                      if isinstance(error, MissingPermissions):
                          text = (f'Sorry {ctx.message.author}, you do not have permission to do that')
                          await ctx.send(text)
                  
                  

                  推薦答案

                  試試這樣的:

                  @client.event
                  async def on_command_error(ctx, error):
                    if isinstance(error, commands.MissingPermissions):
                      await ctx.send("You do not have the permissions required for this command.")
                      return
                  
                    raise error
                  

                  這篇關于如果用戶無權踢球,則無法讓 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 - 自動更改角色顏色)

                1. <tfoot id='NCkZc'></tfoot>
                  • <small id='NCkZc'></small><noframes id='NCkZc'>

                      <bdo id='NCkZc'></bdo><ul id='NCkZc'></ul>

                        <legend id='NCkZc'><style id='NCkZc'><dir id='NCkZc'><q id='NCkZc'></q></dir></style></legend>

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

                            主站蜘蛛池模板: 亚洲一区中文字幕在线观看 | 国产精品一区二区福利视频 | 天天澡天天狠天天天做 | 久久成人18免费网站 | 久久成| 激情91| 免费一看一级毛片 | 日韩超碰 | 亚洲一区二区三区免费观看 | 一区二区三区高清 | 91免费入口 | 欧美 日韩 国产 一区 | 毛片大全 | 欧美国产精品一区二区三区 | 一区二区在线不卡 | 亚洲欧美日韩成人在线 | 视频一区在线观看 | 中文字幕亚洲精品 | 免费精品视频 | 久久精品超碰 | 久久看精品 | 日本视频在线播放 | 久久中文一区二区 | 久久精品成人 | 亚洲精品国产成人 | 亚洲国产成人精品女人久久久 | 国产一区二区三区亚洲 | 日韩一区二区免费视频 | 精品不卡 | 正在播放国产精品 | 国产激情偷乱视频一区二区三区 | www.日韩系列| 国产福利资源在线 | 亚洲美女视频 | 国产一区二区三区精品久久久 | 亚洲精品久久久 | 亚洲欧美精 | 日韩成人在线播放 | 国产在线看片 | 偷拍亚洲色图 | xxxcom在线观看 |