• <small id='1l6lt'></small><noframes id='1l6lt'>

  • <legend id='1l6lt'><style id='1l6lt'><dir id='1l6lt'><q id='1l6lt'></q></dir></style></legend>

  • <tfoot id='1l6lt'></tfoot>
      <bdo id='1l6lt'></bdo><ul id='1l6lt'></ul>

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

        Discord 'on_member_join' 功能不起作用

        时间:2023-09-11
          <bdo id='1Jrj8'></bdo><ul id='1Jrj8'></ul>
          <legend id='1Jrj8'><style id='1Jrj8'><dir id='1Jrj8'><q id='1Jrj8'></q></dir></style></legend>

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

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

                  本文介绍了Discord 'on_member_join' 功能不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我的 on_member_join 似乎不起作用.我希望我的机器人说出加入服务器的成员的姓名,但它不检测是否有人加入或离开.

                  My on_member_join doesnt seem to work. I wanted my bot to say out the names of the members that joined the sever but it doesnt detect if someone has joined or left.

                  import discord
                  from discord.ext import commands
                  
                  client = commands.Bot(command_prefix = '.')
                  
                  @client.event
                  async def on_ready():
                      print("bot is ready ")
                  
                  @client.event
                  async def on_member_join(member):
                      print(f'{member.name} has joined this server')
                  
                  @client.event
                  async def on_member_remove(member):
                      print(f'{member}was removed')
                  
                  client.run('*************************')
                  

                  它正在打印bot is ready";在终端上,因此机器人正在工作.但是没有检测到成员离开或加入请帮助.

                  It is printing "bot is ready" on the terminal so the bot is working. But isn't detecting members leaving or joining pls help.

                  推荐答案

                  你使用的可能是discord python 1.5.0或以上版本,这是一个常见的错误,你只需要意图.如果有错误,您应该阅读它,它会将您重定向到 discord 开发门户中的机器人,在那里您可以激活特权网关意图 看看这个

                  You're probably using discord python 1.5.0 or above, it's a common error, you just need Intents. If there's a error, you are supposed to read it, it will redirect you to your bot in the discord dev portal, there you can activate the privileged gateway intents check this out

                  并将其添加到您的代码中

                  And add this to your code

                  intents = discord.Intents.default()
                  intents.members = True
                  
                  client = commands.Bot(command_prefix='.', intents=intents)
                  

                  这篇关于Discord 'on_member_join' 功能不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何在 discord.py 中使命令不区分大小写 下一篇:Discord.py on_member_join 不起作用,没有错误消息

                  相关文章

                  最新文章

                1. <small id='3r3qa'></small><noframes id='3r3qa'>

                  <legend id='3r3qa'><style id='3r3qa'><dir id='3r3qa'><q id='3r3qa'></q></dir></style></legend>

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