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

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

      <tfoot id='SPPAw'></tfoot>
      • <bdo id='SPPAw'></bdo><ul id='SPPAw'></ul>

      1. Discord.py 禁止命令

        时间:2023-09-09

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

              • <bdo id='KH5TH'></bdo><ul id='KH5TH'></ul>

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

                  <legend id='KH5TH'><style id='KH5TH'><dir id='KH5TH'><q id='KH5TH'></q></dir></style></legend>
                    <tbody id='KH5TH'></tbody>
                  本文介绍了Discord.py 禁止命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                      if message.content.upper().startswith('!BAN'):
                          if "449706643710541824" in [role.id for role in message.author.roles]:
                              await
                  

                  我有基本设置,所以只有管理员可以禁止.我想发出禁令命令,但我不知道该怎么做.

                  I have the base setup so only admins can ban. I want to make the ban command, but I'm not sure how to do it.

                  推荐答案

                  我为我的 bot 获得的禁令命令是,显然不要对禁令部分保留评论,我只是在我不知道怎么做的时候把它放在那里将其锁定为角色

                  My ban command i got for my bot is , obviously dont keep the comment out for the ban part, I just put that there when i didn't know how to lock it to roles

                  #bans a user with a reason
                  @client.command()
                  @commands.has_any_role("Keyblade Master","Foretellers")
                  async def ban (ctx, member:discord.User=None, reason =None):
                      if member == None or member == ctx.message.author:
                          await ctx.channel.send("You cannot ban yourself")
                          return
                      if reason == None:
                          reason = "For being a jerk!"
                      message = f"You have been banned from {ctx.guild.name} for {reason}"
                      await member.send(message)
                      # await ctx.guild.ban(member, reason=reason)
                      await ctx.channel.send(f"{member} is banned!")
                  

                  这篇关于Discord.py 禁止命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用机器人 DM 所有人 - discord.py 下一篇:Python - 是否可以在 Discord.py-v1.0 中等待一个事件或

                  相关文章

                  最新文章

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

                    <tfoot id='rN8xt'></tfoot>

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

                    1. <legend id='rN8xt'><style id='rN8xt'><dir id='rN8xt'><q id='rN8xt'></q></dir></style></legend>

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