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

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

      1. <legend id='IEaTe'><style id='IEaTe'><dir id='IEaTe'><q id='IEaTe'></q></dir></style></legend>
          <bdo id='IEaTe'></bdo><ul id='IEaTe'></ul>
      2. Python - 将频道添加到类别

        时间:2023-10-11
          • <tfoot id='TFMZE'></tfoot>
              <tbody id='TFMZE'></tbody>
              <bdo id='TFMZE'></bdo><ul id='TFMZE'></ul>
              <legend id='TFMZE'><style id='TFMZE'><dir id='TFMZE'><q id='TFMZE'></q></dir></style></legend>
              <i id='TFMZE'><tr id='TFMZE'><dt id='TFMZE'><q id='TFMZE'><span id='TFMZE'><b id='TFMZE'><form id='TFMZE'><ins id='TFMZE'></ins><ul id='TFMZE'></ul><sub id='TFMZE'></sub></form><legend id='TFMZE'></legend><bdo id='TFMZE'><pre id='TFMZE'><center id='TFMZE'></center></pre></bdo></b><th id='TFMZE'></th></span></q></dt></tr></i><div id='TFMZE'><tfoot id='TFMZE'></tfoot><dl id='TFMZE'><fieldset id='TFMZE'></fieldset></dl></div>

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

                  本文介绍了Python - 将频道添加到类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我正在尝试创建一个将在类别中创建的频道,但我尝试过的事情没有奏效

                  I'm trying to create a channel that'll be created in a category but the things I've tried haven't worked

                  代码很大,所以我不会显示所有内容,只是添加频道

                  The code is pretty big so I won't be showing everything, just down to adding the channel

                  @client.command()
                  @has_permissions(kick_members=True)
                  async def warn(ctx, member:discord.Member, *, reason=None):
                   arg=reason
                   author=ctx.author
                   guild=ctx.message.guild
                   overwritee = discord.PermissionOverwrite()
                   overwrite = discord.PermissionOverwrite()
                   channel = get(guild.text_channels, name='warn-logs')
                   category = get(guild.category_channels, name='Multi-Logs')
                   mrole = get(ctx.guild.roles, name="Multi-Galaxy")
                  
                   if category is None:
                    category = await guild.create_category_channel("Multi-Logs")
                    overwritee.read_messages = False
                    overwritee.read_message_history = False
                    overwritee.send_messages = False
                    overwrite.read_messages = True
                    overwrite.read_message_history = True
                    overwrite.send_messages = True
                    await channel.set_permissions(guild.default_role, overwrite=overwritee)
                    await channel.set_permissions(mrole, overwrite=overwrite)
                   if channel is None:
                    channel = await guild.create_text_channel('warn-logs')
                    overwritee.read_messages = False
                    overwritee.read_message_history = False
                    overwritee.send_messages = False
                    overwrite.read_messages = True
                    overwrite.read_message_history = True
                    overwrite.send_messages = True
                    await channel.set_permissions(guild.default_role, overwrite=overwritee)
                    await channel.set_permissions(mrole, overwrite=overwrite)
                  

                  它只是创建类别 &频道彼此分开,因此频道不在类别中

                  It just creates the category & the channel apart from each other, so the channel isn't in the category

                  推荐答案

                  只需在 category.html#discord.Guild.create_text_channel" rel="nofollow noreferrer">create_text_channel:

                  Simply pass in a category in create_text_channel:

                  if channel is None:
                      channel = await guild.create_text_channel('warn-logs', category=category)
                      #                                                      ^^^^^^^^^^^^^^^^^
                      #                                  keyword-argument––––^^^^^^^^
                      #                                        your-variable––––––––––^^^^^^^^
                  

                  这篇关于Python - 将频道添加到类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Discord python关于角色授予事件 下一篇:Discord money bot 将用户 ID 保存在 json 文件中.当 B

                  相关文章

                  最新文章

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

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

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