<tfoot id='OJF4k'></tfoot>

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

        如何提及命令的发送者?不和谐.py

        时间:2023-10-11

            <bdo id='Tir54'></bdo><ul id='Tir54'></ul>
          • <legend id='Tir54'><style id='Tir54'><dir id='Tir54'><q id='Tir54'></q></dir></style></legend>

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

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

                <tbody id='Tir54'></tbody>
                • <tfoot id='Tir54'></tfoot>
                  本文介绍了如何提及命令的发送者?不和谐.py的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我创建了一个超级简单的 .report <person> 命令.我有它,所以当有人键入它时它将被发送到某个频道.我想做的是让它显示报告其他用户的用户的名称.我不知道该怎么做.有谁知道最好的方法吗?

                  I created a super simple .report <person> command. I have it so it will be sent to a certain channel when someone types it. What I wanted to do is have it display the name of the user who reported the other user. I don't know how to go about doing that. Does anyone know the best way?

                  @bot.command()
                  async def report(*, message):
                      await bot.delete(message)
                      await bot.send_message(bot.get_channel("479177111030988810"), message)
                  

                  推荐答案

                  你可以这样做,获取上下文 (ctx) 并从中获取消息的内容及其作者

                  You could do something like this, where you take the context (ctx) and from it get the contents of the message and its author

                  @bot.command(pass_context=True)
                  async def report(ctx):
                      await bot.delete_message(ctx.message)
                      report = f""{ctx.message.content[8:]}"  sent by {ctx.message.author}"
                      await bot.send_message(bot.get_channel("479177111030988810"), report)
                  

                  这篇关于如何提及命令的发送者?不和谐.py的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:是一种对命令使用前缀和 ping 的方法吗? 下一篇:体验 (XP) 不适用于所有用户 JSON Discord.PY

                  相关文章

                  最新文章

                  1. <small id='It7OD'></small><noframes id='It7OD'>

                  2. <tfoot id='It7OD'></tfoot>

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

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