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

      <legend id='7JmLq'><style id='7JmLq'><dir id='7JmLq'><q id='7JmLq'></q></dir></style></legend>
    1. <small id='7JmLq'></small><noframes id='7JmLq'>

      <tfoot id='7JmLq'></tfoot>
          <bdo id='7JmLq'></bdo><ul id='7JmLq'></ul>

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

        如何防止用戶在頻道中發(fā)送多條消息?

        How do I prevent a user from sending more than one message in a channel?(如何防止用戶在頻道中發(fā)送多條消息?)

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

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

                <tfoot id='GbViN'></tfoot>
                • 本文介紹了如何防止用戶在頻道中發(fā)送多條消息?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  User 1: Hello!
                  User 1: How are you?
                  User 2: I'm good.
                  User 2: hbu
                  User 3: hey guys!
                  User 1: i'm doing fine
                  

                  我正在嘗試從用戶 1 和用戶 2 中刪除第二條消息,這樣任何用戶都只能發(fā)送一條消息.我被告知要使用 channel.history,但我想不出一種方法來(lái)比較消息的作者以確保它們不是同一個(gè)人.

                  I'm trying to delete the second message from User 1 and User 2, so that any user can only send a single message. I was told to use channel.history, but I can't think of a way to compare the author's of the messages to make sure they aren't the same person.

                  這就是我想要的:我想防止重復(fù)發(fā)布:

                  This is what I want: I want to prevent double posting:

                  User 1: Hello! How are you?
                  User 2: I'm good, hbu.
                  User 3: hey guys!
                  User 1: i'm doing fine
                  

                  我只是不知道如何使用 channel.history 來(lái)做到這一點(diǎn).

                  I just don't know how to use channel.history to do this.

                  推薦答案

                  您可以使用 on_message() 事件并將頻道歷史記錄的限制設(shè)置為 2:

                  You can use the on_message() event and set the channel history's limit to 2 for this:

                  @bot.event
                  async def on_message(message):
                      recent_author = (await message.channel.history(limit=2).flatten())[1].author
                      if message.author == recent_author:
                          await message.delete()
                  

                  history() 協(xié)程首先獲取最新消息,除非另有說(shuō)明,因此您可以將限制設(shè)置為 2 以獲取用戶剛剛發(fā)送的消息之前的最新消息.

                  The history() coroutine gets the newest messages first, unless specified otherwise, so you can set the limit to 2 to get the most recent message before the one the user just sent.

                  參考資料:

                  • Messageable.history()
                  • Message.author
                  • Message.delete()

                  這篇關(guān)于如何防止用戶在頻道中發(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)更改角色顏色)

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

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

                          <i id='HeHnq'><tr id='HeHnq'><dt id='HeHnq'><q id='HeHnq'><span id='HeHnq'><b id='HeHnq'><form id='HeHnq'><ins id='HeHnq'></ins><ul id='HeHnq'></ul><sub id='HeHnq'></sub></form><legend id='HeHnq'></legend><bdo id='HeHnq'><pre id='HeHnq'><center id='HeHnq'></center></pre></bdo></b><th id='HeHnq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HeHnq'><tfoot id='HeHnq'></tfoot><dl id='HeHnq'><fieldset id='HeHnq'></fieldset></dl></div>
                          1. <tfoot id='HeHnq'></tfoot>
                              <tbody id='HeHnq'></tbody>
                            主站蜘蛛池模板: 在线欧美一区二区 | 免费看黄色小视频 | 日韩午夜 | 国产精品美女www爽爽爽视频 | 亚洲国产成人av好男人在线观看 | 亚洲国产精品激情在线观看 | 亚洲精美视频 | 免费看国产一级特黄aaaa大片 | 国产精品91久久久久久 | 国产三区四区 | 国产成人艳妇aa视频在线 | 一级毛片黄片 | 国产综合区| 在线中文字幕亚洲 | 日韩中文字幕一区二区 | 国产精品国产精品国产专区不片 | 日本不卡高清视频 | 国产精品美女久久久 | 2022精品国偷自产免费观看 | 亚洲国产成人精品久久久国产成人一区 | 91精品久久久久久综合五月天 | 欧美在线一级 | 亚洲日韩中文字幕 | 99热.com | 欧美中文字幕一区二区三区亚洲 | 国产精品视频在线播放 | 精品视频在线观看 | 精品欧美黑人一区二区三区 | 91在线精品秘密一区二区 | 手机看片169 | 中文字幕在线视频观看 | 亚洲人va欧美va人人爽 | 亚洲国产成人精品久久 | 在线视频日韩 | 欧美视频第二页 | 中文字幕在线视频免费观看 | www国产亚洲精品久久网站 | 亚洲黄色av| a免费在线| 亚洲综合久久精品 | 亚洲精品播放 |