【发布时间】:2021-01-15 01:32:53
【问题描述】:
我希望我的 discord 机器人为我服务器中的成员点名。这是我尝试过的,但它不起作用。
import discord
import os
from discord.ext import commands
from discord.utils import get
ROLE = '758778940977709056'
@client.command
async def addrole(ctx, member : discord.Member):
role = get(member.guild.roles, name=ROLE)
await member.add_roles(role)
print(f'{member} was given {role}')
【问题讨论】:
-
您能提供更多细节吗?它以什么方式不起作用?它做什么而不是工作?有没有给出错误?
标签: python python-3.x asynchronous discord discord.py