ctx缺少1个必需参数

时间:2019-08-19 09:11:09

标签: python discord.py

嘿,我想让服务器的所有成员都具有特定角色。 id是服务器的ID。


@client.event
async def on_message(message, ctx):
    global messages
    messages += 1
    id = client.get_guild(SERVER_ID)
    channels = ["commands"]
    valid_users = ["Meiyo#9051"]
    bad_words =["bad", "stop", "45"]
    role = discord.utils.get(id.roles, name="check_in")
      if str(message.channel) in channels and str(message.author) in valid_users:
        if message.content.find("!start") != -1:
            if role is None:
                await message.channel.send('There is no "mod" role on this server!')
                return
            empty = True
            for member in ctx.message.server.members:
                if role in member.roles:
                    await message.channel.send("{0.name}: {0.id}".format(member))
                    empty = False
            if empty:
                await message.channel.send("Nobody has the role {}".format(role.mention))

0 个答案:

没有答案