久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

    1. <i id='wEK4t'><tr id='wEK4t'><dt id='wEK4t'><q id='wEK4t'><span id='wEK4t'><b id='wEK4t'><form id='wEK4t'><ins id='wEK4t'></ins><ul id='wEK4t'></ul><sub id='wEK4t'></sub></form><legend id='wEK4t'></legend><bdo id='wEK4t'><pre id='wEK4t'><center id='wEK4t'></center></pre></bdo></b><th id='wEK4t'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wEK4t'><tfoot id='wEK4t'></tfoot><dl id='wEK4t'><fieldset id='wEK4t'></fieldset></dl></div>
        <bdo id='wEK4t'></bdo><ul id='wEK4t'></ul>
        <tfoot id='wEK4t'></tfoot>
        <legend id='wEK4t'><style id='wEK4t'><dir id='wEK4t'><q id='wEK4t'></q></dir></style></legend>
      1. Python - DM 一個用戶 Discord 機器人

        Python - DM a User Discord Bot(Python - DM 一個用戶 Discord 機器人)

            <tfoot id='75SBN'></tfoot>
              • <i id='75SBN'><tr id='75SBN'><dt id='75SBN'><q id='75SBN'><span id='75SBN'><b id='75SBN'><form id='75SBN'><ins id='75SBN'></ins><ul id='75SBN'></ul><sub id='75SBN'></sub></form><legend id='75SBN'></legend><bdo id='75SBN'><pre id='75SBN'><center id='75SBN'></center></pre></bdo></b><th id='75SBN'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='75SBN'><tfoot id='75SBN'></tfoot><dl id='75SBN'><fieldset id='75SBN'></fieldset></dl></div>
                  <tbody id='75SBN'></tbody>

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

                  <small id='75SBN'></small><noframes id='75SBN'>

                  本文介紹了Python - DM 一個用戶 Discord 機器人的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 Python 開發 User Discord Bot.如果 bot 所有者鍵入 !DM @user,那么 bot 將 DM 所有者提到的用戶.

                  I'm working on a User Discord Bot in Python .If the bot owner types !DM @user then the bot will DM the user that was mentioned by the owner.

                  @client.event
                  async def on_message(message):
                      if message.content.startswith('!DM'):
                          msg = 'This Message is send in DM'
                          await client.send_message(message.author, msg)
                  

                  推薦答案

                  最簡單的方法是使用 discord.ext.commands 擴展.這里我們使用 converter 來獲取目標用戶,和一個 keyword-only 參數發送給他們的可選消息:

                  The easiest way to do this is with the discord.ext.commands extension. Here we use a converter to get the target user, and a keyword-only argument as an optional message to send them:

                  from discord.ext import commands
                  import discord
                  
                  bot = commands.Bot(command_prefix='!')
                  
                  @bot.command(pass_context=True)
                  async def DM(ctx, user: discord.User, *, message=None):
                      message = message or "This Message is sent via DM"
                      await bot.send_message(user, message)
                  
                  bot.run("TOKEN")
                  


                  對于較新的 1.0+ 版本的 discord.py,您應該使用 send 而不是 send_message

                  from discord.ext import commands
                  import discord
                  
                  bot = commands.Bot(command_prefix='!')
                  
                  @bot.command()
                  async def DM(ctx, user: discord.User, *, message=None):
                      message = message or "This Message is sent via DM"
                      await user.send(message)
                  
                  bot.run("TOKEN")
                  

                  這篇關于Python - DM 一個用戶 Discord 機器人的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)

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

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

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

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

                            主站蜘蛛池模板: 91视频专区 | 黄色一区二区三区 | 亚洲理论片 | 少妇高潮露脸国语对白 | 一级做a爱片性色毛片 | 日本精品久久久 | 青青草免费在线视频 | 一区二区三区精品 | 在线观看免费黄色 | 日韩黄色av| 久久久久久中文字幕 | 欧美日韩在线一区二区三区 | 韩日一级片 | 午夜精品久久久久久 | 日韩久久网 | 99国产精品99久久久久久 | 欧美精品久久久久久久 | 精品日韩在线观看 | 亚色视频 | 综合久久久 | 中文字幕三区 | 中文字幕在线观看日韩 | 中文字幕日韩视频 | 久久av网站 | 男人操女人的网站 | 一区二区三区免费 | 中文字幕一区二区三区乱码 | 久久合| 精品国产一区二区三区久久久蜜月 | 亚洲在线视频观看 | 日日干夜夜干 | 国产精品福利在线观看 | 国产精品美女www爽爽爽 | 成人女同在线观看 | 99视频在线精品免费观看2 | 性猛交xxxx富婆老太婆 | 天天干天天拍 | 国产二区精品 | 日韩1区2区| 在线观看黄色小视频 | 日韩a在线 |