<small id='1bSIK'></small><noframes id='1bSIK'>

    1. <legend id='1bSIK'><style id='1bSIK'><dir id='1bSIK'><q id='1bSIK'></q></dir></style></legend>

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

        discord.py - 自动更改角色颜色

        时间:2023-10-11

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

          1. <tfoot id='C3aGp'></tfoot>

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

                  <tbody id='C3aGp'></tbody>
                  <bdo id='C3aGp'></bdo><ul id='C3aGp'></ul>
                  本文介绍了discord.py - 自动更改角色颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我试图让角色 RGB 每 5 秒更改一次颜色 redyellow

                  I was trying to make so the role RGB Changes to color red and yellow every 5 seconds

                  async def runtime_background_task(role = discord.Role):
                     while not bot.is_closed:
                         await bot.edit_role(server="493121776402825219", role="RGB", colour=discord.Colour(0xff0000))
                         await asyncio.sleep(5)
                         await bot.edit_role(server="493121776402825219", role="RGB", colour=discord.Colour(0xffff00))
                  

                  推荐答案

                  你可以试试这样的

                  @bot.event
                  async def on_ready():
                    server = bot.get_server("493121776402825219")
                    return server
                  
                  async def runtime_background_task():
                    colours = [0xFF0000, 0x00FF00, 0x0000FF0]
                    i = 0
                  
                    server = await on_ready()
                    role = discord.utils.get(server.roles, name="RGB")
                  
                    while not bot.is_closed:
                      i = (i + 1) % 3
                      await bot.edit_role(server=server, role=role, colour=discord.Colour(colours[i]))
                  
                      await asyncio.sleep(5)
                  
                  bot.loop.create_task(runtime_background_task())
                  

                  这篇关于discord.py - 自动更改角色颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:ModuleNotFoundError:没有名为“cogs"的模块 下一篇:如何在 heroku 上托管我的 discord.py 机器人?

                  相关文章

                  最新文章

                  <legend id='Gzgtr'><style id='Gzgtr'><dir id='Gzgtr'><q id='Gzgtr'></q></dir></style></legend>
                  1. <tfoot id='Gzgtr'></tfoot>

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

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

                        <bdo id='Gzgtr'></bdo><ul id='Gzgtr'></ul>