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

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

      <tfoot id='hOEeV'></tfoot>

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

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

      如何使用机器人 DM 所有人 - discord.py

      时间:2023-09-09
    3. <i id='CeqMv'><tr id='CeqMv'><dt id='CeqMv'><q id='CeqMv'><span id='CeqMv'><b id='CeqMv'><form id='CeqMv'><ins id='CeqMv'></ins><ul id='CeqMv'></ul><sub id='CeqMv'></sub></form><legend id='CeqMv'></legend><bdo id='CeqMv'><pre id='CeqMv'><center id='CeqMv'></center></pre></bdo></b><th id='CeqMv'></th></span></q></dt></tr></i><div id='CeqMv'><tfoot id='CeqMv'></tfoot><dl id='CeqMv'><fieldset id='CeqMv'></fieldset></dl></div>

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

          <tbody id='CeqMv'></tbody>

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

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

              1. 本文介绍了如何使用机器人 DM 所有人 - discord.py的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                嗯,我正在使用直接消息功能向特定用户发送消息,但我一直在寻找方法,以便可以向服务器上的每个人发送消息,但我不明白.我使用 discord.py 0.16.9 作为参考.这是我当前的代码:

                Well, I'm doing a Direct Message function to DM a specific user, but I've been searching the way to do it so I can message everyone on a server, and I don't get it. I'm using discord.py 0.16.9 for reference. Here is my current code:

                @client.command(pass_context = True)
                async def dm(ctx, member : discord.Member = None, *, message):
                    if not ctx.message.author.server_permissions.administrator:
                        return
                    if not member:
                        return await client.say(ctx.message.author.mention + "Specify a user to DM!")
                    if member = "@everyone":
                        member = 
                    else:
                        await client.send_message(member, message)
                

                推荐答案

                正如评论中已经说明的那样,对所有人进行 dm 确实不是一个好主意,但如果必须,您可以遍历服务器的所有成员并单独向他们发送消息.在您的示例中:

                As already stated in a comment, it really isn't a good idea to dm everyone, but if you must, you can iterate over all members of a server and message them individually. In your example:

                if member == "@everyone":
                    for server_member in ctx.message.server.members:
                        await client.send_message(server_member, message)
                

                这篇关于如何使用机器人 DM 所有人 - discord.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:如何让不和谐机器人输出用户输入的所有内容, 下一篇:Discord.py 禁止命令

                相关文章

                最新文章

                  <tfoot id='G0w1Q'></tfoot>

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

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