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

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

      <tfoot id='442nB'></tfoot>
        <bdo id='442nB'></bdo><ul id='442nB'></ul>
      <legend id='442nB'><style id='442nB'><dir id='442nB'><q id='442nB'></q></dir></style></legend>

      1. 如何讓我的 Python Discord 機(jī)器人檢查消息是否由機(jī)

        How can make my Python Discord bot I check if a message was sent by the bot itself?(如何讓我的 Python Discord 機(jī)器人檢查消息是否由機(jī)器人本身發(fā)送?)

      2. <tfoot id='TuLSl'></tfoot>
            • <small id='TuLSl'></small><noframes id='TuLSl'>

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

                  本文介紹了如何讓我的 Python Discord 機(jī)器人檢查消息是否由機(jī)器人本身發(fā)送?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在使用 Python (v. 3.6.1) 編寫一個(gè) Discord 機(jī)器人,它檢測(cè)在一個(gè)頻道中發(fā)送的所有消息并在同一頻道中回復(fù)它們.但是,機(jī)器人會(huì)自行回復(fù)消息,從而導(dǎo)致無(wú)限循環(huán).

                  I am writing a Discord bot using Python (v. 3.6.1) which detects all messages sent in a channel and replies to them in that same channel. However, the bot replies to messages by itself, causing an infinite loop.

                  @bot.event
                  async def on_message(message)
                      await bot.send_message(message.channel, message.content)```
                  

                  我該如何解決這個(gè)問(wèn)題?

                  How would I fix this?

                  推薦答案

                  message 類包含有關(guān)消息的 author,您可以使用它來(lái)確定是否回復(fù)消息.作者會(huì)員 對(duì)象(或其超類 User 如果頻道是私有的),它具有 id 屬性,但也支持用戶之間的直接邏輯比較.

                  The message class contains information on the message's author, which you can utilize to determine whether or not to respond to the message. author is a Member object (or its superclass User if the channel is private), which has an id property but also supports direct logical comparisons between users.

                  例如:

                  @bot.event
                  async def on_message(message):
                      if message.author != bot.user:
                          await bot.send_message(message.channel, message.content)
                  

                  應(yīng)該按需要發(fā)揮作用

                  這篇關(guān)于如何讓我的 Python Discord 機(jī)器人檢查消息是否由機(jī)器人本身發(fā)送?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個(gè)在 Python 中提供角色的不和諧機(jī)器人?)
                  Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒(méi)有響應(yīng)命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動(dòng)更改角色顏色)

                        <tbody id='B1qru'></tbody>

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

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

                        • <bdo id='B1qru'></bdo><ul id='B1qru'></ul>
                        • <i id='B1qru'><tr id='B1qru'><dt id='B1qru'><q id='B1qru'><span id='B1qru'><b id='B1qru'><form id='B1qru'><ins id='B1qru'></ins><ul id='B1qru'></ul><sub id='B1qru'></sub></form><legend id='B1qru'></legend><bdo id='B1qru'><pre id='B1qru'><center id='B1qru'></center></pre></bdo></b><th id='B1qru'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='B1qru'><tfoot id='B1qru'></tfoot><dl id='B1qru'><fieldset id='B1qru'></fieldset></dl></div>
                          <tfoot id='B1qru'></tfoot>
                            主站蜘蛛池模板: 噜噜噜噜狠狠狠7777视频 | 欧美中文在线 | 欧美精品1区 | 中文精品视频 | 在线观看av网站永久 | 久久国产成人午夜av影院武则天 | 中文字幕亚洲一区 | 一级a爱片久久毛片 | 中文字幕精品一区 | 国产精品日韩 | 亚洲精品高清视频在线观看 | 在线播放亚洲 | 精品国产乱码久久久久久1区2区 | 欧美成人自拍 | 91亚洲国产 | 国产精品一级 | 激情欧美一区二区三区中文字幕 | 欧洲精品在线观看 | 美女在线观看av | 国产精品国产a | 国产精品一区二区在线播放 | 99久久久99久久国产片鸭王 | 超级乱淫av片免费播放 | 黄色网址在线免费播放 | 久久se精品一区精品二区 | jizz亚洲人| 久久精品久久久 | 欧洲av一区 | 在线观看成人小视频 | 天堂av在线影院 | 成人美女免费网站视频 | 午夜影院在线观看视频 | 91精产国品一二三区 | 精品欧美一区二区久久久伦 | 色就是色欧美 | 成人激情视频网 | 久久精品网 | 欧美中文字幕一区二区 | 狠狠色狠狠色综合系列 | 欧美精品欧美精品系列 | 九九综合|