久久久久久久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>
                            主站蜘蛛池模板: 久久久91精品国产一区二区三区 | 成人免费毛片在线观看 | 久久精品一 | 国产精品久久久久久久久久免费看 | 91网站在线观看视频 | 激情久久网 | 中文在线一区二区 | 欧美精品久久 | 99免费在线观看视频 | 免费影视在线观看 | 成人a免费| 伦理二区 | 欧美日韩久久精品 | 欧美一级欧美三级在线观看 | 一区二区三区视频 | 亚洲免费观看视频网站 | 国产精品成人69xxx免费视频 | 色男人的天堂 | 成人欧美一区二区三区黑人孕妇 | 国产四虎 | 亚洲一区二区在线免费观看 | 亚洲精品一区久久久久久 | 午夜激情在线视频 | 国产草草视频 | 99视频在线免费观看 | 亚洲视频免费观看 | 久久出精品 | 国产美女自拍视频 | 国产精品一区二区在线播放 | 国产成人精品一区二区三 | 欧美日韩国产在线观看 | 污书屋| 天天天操 | 亚洲一二三在线观看 | 国产精品久久精品 | 亚洲激情网站 | 久久久91 | 国产资源视频 | 欧美专区在线视频 | 国产一级成人 | 精品一区二区三区四区在线 |