【发布时间】:2022-10-24 03:30:27
【问题描述】:
我想创建一个提升 cmd,在输入时将成员提升到下一个等级,但我无法删除/添加他的角色
import discord
import os
from discord.utils import get
bot = discord.Bot(intents=discord.Intents.all())
admin = 990420666568278086
#roles
prospect = 869470046953537546
member = 869470100061814784
patched = 1003733917704134737
@bot.event
async def on_ready():
print(f"{bot.user} is ready and online!")
@bot.slash_command(name="promote", description = "Promote people to the next rank")
async def promote(ctx, user: discord.Member):
if ctx.author.get_role(admin):
if user.get_role(prospect):
await user.remove_roles(prospect)
await user.add_roles(member, patched)
bot.run("DISCORD-TOKEN")
【问题讨论】:
标签: python discord.py command bots pycord