如何获取帮主身份

2024-05-16 11:50:44 发布

您现在位置:Python中文网/ 问答频道 /正文

因此,基本上我正在尝试生成只有服务器所有者和服务器所有者授予权限的人才能使用的管理命令,但是我不能使用:

owner = discord.guild.owner_id

我找了别的方法,但什么也没找到。这是我的密码:

import discord

owner = guild.owner_id
operators = [owner]

@bot.command()
async def op(ctx, *new_operator):
    global operators
    if ctx.author.id in operators:
        operators.append(new_operator)
        await ctx.send("Successfully added a new operator")
    else:
        await ctx.send("Insufficient Permissions")

我希望将所有者id添加到列表中,但这不起作用,因为我遇到以下错误:

Class 'Guild' has no 'owner_id' member

Tags: 方法命令服务器sendid权限newawait