<tfoot id='W2cBu'></tfoot>

    • <bdo id='W2cBu'></bdo><ul id='W2cBu'></ul>

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

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

      <i id='W2cBu'><tr id='W2cBu'><dt id='W2cBu'><q id='W2cBu'><span id='W2cBu'><b id='W2cBu'><form id='W2cBu'><ins id='W2cBu'></ins><ul id='W2cBu'></ul><sub id='W2cBu'></sub></form><legend id='W2cBu'></legend><bdo id='W2cBu'><pre id='W2cBu'><center id='W2cBu'></center></pre></bdo></b><th id='W2cBu'></th></span></q></dt></tr></i><div id='W2cBu'><tfoot id='W2cBu'></tfoot><dl id='W2cBu'><fieldset id='W2cBu'></fieldset></dl></div>
      1. 在没有聊天的情况下识别某人正在玩的游戏(不和谐的僵尸蟒蛇)

        Recognizing a game that someone is playing without chatting(discord bot python)(在没有聊天的情况下识别某人正在玩的游戏(不和谐的僵尸蟒蛇))

        • <bdo id='aN3cj'></bdo><ul id='aN3cj'></ul>

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

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

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

                    <tbody id='aN3cj'></tbody>
                  本文介绍了在没有聊天的情况下识别某人正在玩的游戏(不和谐的僵尸蟒蛇)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  (不和谐僵尸蟒蛇)

                  代码是,如果有人聊天,如果此人正在玩Overwatch,他或她将被提升为Gamer角色,如果不是,他或她将被删除,否则将不会发生任何事情。但是我在寻找一种不聊天就能认出正在玩的游戏的方法。有人能帮帮我吗?

                  @client.event
                  async def on_message(message):
                      man = message.author.activity.name
                      role = discord.utils.get(message.guild.roles, name="Gamer")
                      if man == "Overwatch":
                          await message.author.add_roles(role)
                      else:
                          await message.author.remove_roles(role)
                  

                  推荐答案

                  只要成员更改其活动就会触发on_member_update事件:

                  @client.event
                  async def on_member_update(before, after)
                      role = discord.utils.get(after.guild.roles, name="Gamer")
                      if before.activities != after.activities:
                          name = "Overwatch"
                          before_name = any(activity.name for activity in before.activities)
                          after_name = any(activity.name for activity in after.activities)
                          if not before_name and after_name:
                              await after.add_roles(role)
                          elif before_name and not after_name:
                              await after.remove_roles(role)
                  

                  这篇关于在没有聊天的情况下识别某人正在玩的游戏(不和谐的僵尸蟒蛇)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  GUI Freezes while downloading PyQt5 and Pytube(GUI在下载PyQt5和Pytube时冻结)
                  How to solve memory issues while multiprocessing using Pool.map()?(如何解决使用Pool.map()进行多处理时的内存问题?)
                  Python - How to use FastAPI and uvicorn.run without blocking the thread?(Python-如何使用FastAPI和uvicorn.run而不阻塞线程?)
                  How to increment a shared counter from multiple processes?(如何从多个进程递增共享计数器?)
                  Using pika, how to connect to rabbitmq running in docker, started with docker-compose with external network?(使用pika,如何连接运行在docker中的rabbitmq,从docker开始-与外部网络连接?)
                  How to use .rolling() on each row of a Pandas dataframe?(如何对 pandas 数据帧的每一行使用.roll()?)
                      <tbody id='Ibn2U'></tbody>
                  • <legend id='Ibn2U'><style id='Ibn2U'><dir id='Ibn2U'><q id='Ibn2U'></q></dir></style></legend>

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

                          <tfoot id='Ibn2U'></tfoot>
                            <bdo id='Ibn2U'></bdo><ul id='Ibn2U'></ul>

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