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

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

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

  • <tfoot id='Kqhey'></tfoot>

    <i id='Kqhey'><tr id='Kqhey'><dt id='Kqhey'><q id='Kqhey'><span id='Kqhey'><b id='Kqhey'><form id='Kqhey'><ins id='Kqhey'></ins><ul id='Kqhey'></ul><sub id='Kqhey'></sub></form><legend id='Kqhey'></legend><bdo id='Kqhey'><pre id='Kqhey'><center id='Kqhey'></center></pre></bdo></b><th id='Kqhey'></th></span></q></dt></tr></i><div id='Kqhey'><tfoot id='Kqhey'></tfoot><dl id='Kqhey'><fieldset id='Kqhey'></fieldset></dl></div>
      1. 如何在 on_member_join() discord.py 中向成员发送私人消

        时间:2023-09-09
          <tbody id='3aL4C'></tbody>

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

            2. <small id='3aL4C'></small><noframes id='3aL4C'>

                • <legend id='3aL4C'><style id='3aL4C'><dir id='3aL4C'><q id='3aL4C'></q></dir></style></legend>
                  本文介绍了如何在 on_member_join() discord.py 中向成员发送私人消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  这就是我所拥有的:

                  @client.command(pass_context=True)
                  @client.event
                  async def on_member_join(ctx, member):
                      print(f'{member} has joined a server.')
                      await ctx.send(f"Hello {member}!")
                      await ctx.member.send(f"Welcome to the server!")
                  

                  我需要机器人在他加入时发送一条包含规则和命令列表的私人消息.

                  I need the bot to send a private message containing rules and commands list when he joins.

                  请帮忙!

                  推荐答案

                  事件 on_member_join() 只接受 member 作为有效参数(参见 doc).因此,您尝试执行的操作: on_member_join(ctx, member) 将无法正常工作.你需要改用这个:on_member_join(member).

                  The event on_member_join() only accepts member as a valid parameter (see doc). Thus what you try to do: on_member_join(ctx, member) ,wont work. You need to use this instead: on_member_join(member).

                  如果你按如下方式使用事件:

                  If you used the event as follows:

                  @client.event
                  async def on_member_join(member):
                      await member.send('Private message')
                  

                  您可以直接向加入服务器的成员发送消息.因为你得到一个 member 对象使用这个事件.

                  You can send messages directly to members who joined the server. Because you get an member object using this event.

                  这篇关于如何在 on_member_join() discord.py 中向成员发送私人消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:首次完成 Discord Bot 后如何播放下一首歌曲 下一篇:使用 discord.py 更改角色层次结构

                  相关文章

                  最新文章

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

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

                    2. <small id='ThSVh'></small><noframes id='ThSVh'>

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