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

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

        <bdo id='qbYDa'></bdo><ul id='qbYDa'></ul>
    2. <small id='qbYDa'></small><noframes id='qbYDa'>

      <legend id='qbYDa'><style id='qbYDa'><dir id='qbYDa'><q id='qbYDa'></q></dir></style></legend>
      <i id='qbYDa'><tr id='qbYDa'><dt id='qbYDa'><q id='qbYDa'><span id='qbYDa'><b id='qbYDa'><form id='qbYDa'><ins id='qbYDa'></ins><ul id='qbYDa'></ul><sub id='qbYDa'></sub></form><legend id='qbYDa'></legend><bdo id='qbYDa'><pre id='qbYDa'><center id='qbYDa'></center></pre></bdo></b><th id='qbYDa'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qbYDa'><tfoot id='qbYDa'></tfoot><dl id='qbYDa'><fieldset id='qbYDa'></fieldset></dl></div>
      1. discord.py 試圖刪除用戶的所有角色

        discord.py trying to remove all roles from a user(discord.py 試圖刪除用戶的所有角色)
      2. <tfoot id='1DYYU'></tfoot>

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

                <tbody id='1DYYU'></tbody>
              <legend id='1DYYU'><style id='1DYYU'><dir id='1DYYU'><q id='1DYYU'></q></dir></style></legend>

                • 本文介紹了discord.py 試圖刪除用戶的所有角色的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個(gè)問題,我試圖刪除用戶對(duì)某種靜音角色的所有角色,但它給了我這個(gè)錯(cuò)誤 discord.ext.commands.errors.CommandInvokeError: Command raise an exception: NotFound: 404 Not Found (error code: 10011): Unknown Role

                  I have a problem that I`m trying to remove all roles a user has for some kind of mute role but it gives me this error discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NotFound: 404 Not Found (error code: 10011): Unknown Role

                  這是我的代碼

                  @client.command(aliases=['m'])
                  @commands.has_permissions(kick_members = True)
                  async def mute(ctx,member : discord.Member):
                      muteRole = ctx.guild.get_role(728203394673672333)
                      for i in member.roles:
                          await member.remove_roles(i)
                      await member.add_roles(muteRole)
                      await ctx.channel.purge(limit = 1)
                      await ctx.send(str(member)+' has been muted!')
                  

                  我知道這種問題已經(jīng)在這里問過了:如何一次刪除所有角色 (Discord.py 1.4.1).但它沒有得到回答,根本沒有幫助我

                  I know that this kind of questiion was alredy asked here: How to remove all roles at once (Discord.py 1.4.1). But it wasn`t answered and did not help me at all

                  推薦答案

                  問題是所有用戶都有一個(gè)隱形角色",@everyone.如果你嘗試,你會(huì)看到它出現(xiàn)

                  The problem is that all users have an "invisible role", @everyone. You will see it show up if you try

                  for i in member.roles:
                      print(i)
                  

                  remove_roles 是一個(gè)高級(jí)函數(shù),它會(huì)嘗試刪除導(dǎo)致您的錯(cuò)誤的 @everyone.

                  remove_roles is a high level function and it will try to remove @everyone, which is causing your error.

                  要清除用戶的所有當(dāng)前角色,您可以:

                  To clear all current roles from the user, you can do:

                  @client.command(aliases=['m'])
                  @commands.has_permissions(kick_members = True)
                  async def mute(ctx, member : discord.Member):
                      muteRole = ctx.guild.get_role(775449115022589982)
                      await member.edit(roles=[muteRole]) # Replaces all current roles with roles in list
                      await ctx.channel.purge(limit = 1)
                      await ctx.send(str(member)+' has been muted!')
                  

                  await member.edit(roles=[]) 將所有當(dāng)前角色替換為您在列表中擁有的角色.將列表留空以刪除用戶的所有角色.

                  await member.edit(roles=[]) Replaces all the current roles with the roles you have in the list. Leave the list empty to remove all roles from the user.

                  discord.Member.edit

                  雖然如果你想用 for 循環(huán) 來做,你可以使用 try

                  Although if you want to do it with a for loop, you can use try

                  @client.command(aliases=['m'])
                  @commands.has_permissions(kick_members = True)
                  async def mute(ctx, member : discord.Member):
                      muteRole = ctx.guild.get_role(775449115022589982)
                      for i in member.roles:
                          try:
                              await member.remove_roles(i)
                          except:
                              print(f"Can't remove the role {i}")
                      await member.add_roles(muteRole)
                      await ctx.channel.purge(limit = 1)
                      await ctx.send(str(member)+' has been muted!')
                  

                  這篇關(guān)于discord.py 試圖刪除用戶的所有角色的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(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ī)器人沒有響應(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='SWpM1'><style id='SWpM1'><dir id='SWpM1'><q id='SWpM1'></q></dir></style></legend>
                    • <bdo id='SWpM1'></bdo><ul id='SWpM1'></ul>

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

                      <tfoot id='SWpM1'></tfoot>
                        <tbody id='SWpM1'></tbody>

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

                            主站蜘蛛池模板: 国产激情视频 | 中文字幕在线电影观看 | 欧美性生交大片免费 | 中文字幕第十页 | 96久久久久久 | 亚卅毛片 | 99riav国产一区二区三区 | 免费视频99 | 久久99国产精一区二区三区 | 亚洲精品乱码久久久久v最新版 | 国产精品99久久久久久动医院 | 欧美成年黄网站色视频 | 精品av| 黄在线免费观看 | 国产一区2区| 日韩av第一页| 一级爱爱片| 波多野结衣电影一区 | 亚洲国产一区视频 | www.久久精品视频 | 亚洲精品91 | 国产精品国产三级国产aⅴ无密码 | 99草免费视频 | 国产69久久精品成人看动漫 | 精品伊人| 国产成人99久久亚洲综合精品 | 亚洲精品福利在线 | 日韩欧美三级电影 | 欧美日韩亚洲视频 | 草久网 | 国产欧美精品一区二区三区 | 久久精品国产一区 | 亚洲一区二区三区在线视频 | 欧美日韩中文在线观看 | 黄色毛片免费看 | 国产精品亚洲成在人线 | 国产在线视频一区 | av福利网 | 神马久久春色视频 | 国产精品久久久久久久久久久久久久 | 天堂资源 |