[英]userlist of a specific role in the discord (Python)
我想要一個命令來獲取具有特殊角色的所有用戶的列表。 但這真的行不通。
一切都是輸出,但不是成員。 這里有人知道這是關於什么的嗎? 或者甚至更好的選擇?
提前謝謝了
import discord
import asyncio
from discord import message
from discord.ext import commands
intents = discord.Intents.all()
client = discord.Client(intents=intents)
class ClansCog(commands.Cog, name='Clans'):
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
async def deutsch(self, ctx, *args):
if ctx.channel.type is not discord.ChannelType.private:
await ctx.message.delete()
roll_id = 733988944--------
guild_id = 71911198261------
guild = self.bot.get_guild(guild_id)
partner_role = guild.get_role(roll_id)
print(partner_role.members)
print(partner_role.id)
print(client.guilds)
def setup(bot):
bot.add_cog(ClansCog(bot))
print('Clans loaded!')
從航站樓
[]
733988944533-------
[]
我和一個朋友發現了這個問題。 這是一個意圖問題(感謝 Shnap :))
bot = commands.Bot(command_prefix='d!'.lower(), case_insensitive=True, intents=intents)
缺少意圖=意圖,之后就沒有問題了
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.