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

<tfoot id='TIXPG'></tfoot>
  • <small id='TIXPG'></small><noframes id='TIXPG'>

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

        冷卻映射 |不和諧.py

        Cooldown mapping | Discord.py(冷卻映射 |不和諧.py)

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

              <tfoot id='t4jSy'></tfoot>
              <i id='t4jSy'><tr id='t4jSy'><dt id='t4jSy'><q id='t4jSy'><span id='t4jSy'><b id='t4jSy'><form id='t4jSy'><ins id='t4jSy'></ins><ul id='t4jSy'></ul><sub id='t4jSy'></sub></form><legend id='t4jSy'></legend><bdo id='t4jSy'><pre id='t4jSy'><center id='t4jSy'></center></pre></bdo></b><th id='t4jSy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='t4jSy'><tfoot id='t4jSy'></tfoot><dl id='t4jSy'><fieldset id='t4jSy'></fieldset></dl></div>
                  <bdo id='t4jSy'></bdo><ul id='t4jSy'></ul>
                • <legend id='t4jSy'><style id='t4jSy'><dir id='t4jSy'><q id='t4jSy'></q></dir></style></legend>
                    <tbody id='t4jSy'></tbody>
                  本文介紹了冷卻映射 |不和諧.py的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 on_message 掃描特定關鍵字的代碼,以便機器人可以做出相應的響應,不,我不能使用命令來實現這一點.

                  I am using on_message to scan the code for specific keywords so that the bot can respond accordingly, and no, I cannot use commands to achieve this.

                  我想通過打開冷卻時間來防止人們向這些關鍵字發送垃圾郵件,以便機器人在再次檢查之前等待

                  I want to prevent people from spamming these keywords by turning on a cooldown so the bot will wait before checking again

                  文檔內容:

                  class SomeCog(commands.Cog):
                      def __init__(self):
                          self._cd = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user)
                  
                      async def cog_check(self, ctx):
                          bucket = self._cd.get_bucket(ctx.message)
                          retry_after = bucket.update_rate_limit()
                          if retry_after:
                              # you're rate limited
                              # helpful message here
                              pass
                          # you're not rate limited
                  

                  我有什么:

                  class Listener(commands.Cog):
                      def __init__(self, bot):
                          self._cd = commands.CooldownMapping.from_cooldown(1.0, 10.0, commands.BucketType.user)
                  
                      @commands.Cog.listener()
                      async def on_message(self, message):    
                  
                          async def cog_check(self, message):
                              bucket = self._cd.get_bucket(message)
                              retry_after = bucket.update_rate_limit()
                              if retry_after:
                                  print('test')
                                  pass
                          
                  
                              elif (message.guild is None):  
                                  return '.'
                  
                              else:
                            . . . . . #code which tests for the keywords
                  

                  推薦答案

                  class SomeCog(commands.Cog):
                      def __init__(self, bot):
                          self.bot = bot
                          self._cd = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user) # Put your params here
                                                                          # rate, per, BucketType
                  
                      def ratelimit_check(self, message):
                          """Returns the ratelimit left"""
                          bucket = self._cd.get_bucket(message)
                          return bucket.update_rate_limit()
                  
                  
                      @commands.Cog.listener()
                      async def on_message(self, message):
                          if 'check if the message contains certain words here':
                              # Getting the ratelimit that's left
                              retry_after = self.ratelimit_check(message)
                              if retry_after is None:
                                  # You're not ratelimited
                              else:
                                  # You're ratelimited, you can delete the message here
                                  await message.delete()
                                  await message.channel.send(f"You can't use those words for another {round(retry_after)} seconds.")
                  

                  此處的代碼評估消息是否包含某些單詞,如果包含,則檢查 ratelimit,如果有 - 刪除消息并發送消息.

                  The code here evaluates if the message contains certain words, if it does, checks for ratelimit, if there is one - deletes the message and sends a message.

                  這篇關于冷卻映射 |不和諧.py的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                      <i id='HQMGf'><tr id='HQMGf'><dt id='HQMGf'><q id='HQMGf'><span id='HQMGf'><b id='HQMGf'><form id='HQMGf'><ins id='HQMGf'></ins><ul id='HQMGf'></ul><sub id='HQMGf'></sub></form><legend id='HQMGf'></legend><bdo id='HQMGf'><pre id='HQMGf'><center id='HQMGf'></center></pre></bdo></b><th id='HQMGf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HQMGf'><tfoot id='HQMGf'></tfoot><dl id='HQMGf'><fieldset id='HQMGf'></fieldset></dl></div>
                        <bdo id='HQMGf'></bdo><ul id='HQMGf'></ul>

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

                            <tfoot id='HQMGf'></tfoot>

                          1. <legend id='HQMGf'><style id='HQMGf'><dir id='HQMGf'><q id='HQMGf'></q></dir></style></legend>
                              <tbody id='HQMGf'></tbody>
                            主站蜘蛛池模板: 国产一区二区精品自拍 | 久久av资源网| av黄色国产| 人人艹人人 | av日韩在线播放 | 国产精品区二区三区日本 | 视频二区 | 蜜臀久久99精品久久久久久宅男 | 午夜影院 | 97免费在线观看视频 | 最近日韩中文字幕 | 欧美三区视频 | 亚洲天堂影院 | 九九热视频这里只有精品 | 亚洲国产精品视频 | 成人免费视频网站在线看 | 日韩三级在线观看 | 精品久久久久久 | a在线观看 | 国产99久久久久 | 99热国产在线播放 | 日韩av在线一区二区 | 国产精品一区二区无线 | 久久久久国产精品一区 | 狠狠av| 色爱综合网 | 亚洲国产精品第一区二区 | 97精品超碰一区二区三区 | 国产精品毛片久久久久久久 | 日韩高清三区 | 亚洲欧美一区二区三区视频 | 国产高清精品一区二区三区 | 国产伦精品一区二区三区精品视频 | 日韩免| 久久精品天堂 | 亚洲精品乱码久久久久久9色 | 黄色精品视频网站 | 日韩中文字幕在线 | 久久综合一区二区 | 青青草视频免费观看 | 中文字幕在线一区二区三区 |