当我说 .ban @Example_User 时,我正在尝试制作一个禁止用户的不和谐机器人,但是当我运行代码时没有错误弹出但是当我尝试使用时出现错误,我一直在使用本教程 https://www.youtube.com/watch?v=THj99FuPJmI,下面是我的代码和错误:
import discord
import random
import os
from discord.ext import commands
client = commands.Bot(command_prefix = '.')
@client.event
async def on_ready():
print("Bot is ready")
@client.command()
async def kick(ctx, member : discord.member, * , reason=None):
await member.kick(reason=reason)
@client.command()
async def ban(ctx, member : discord.Member, *, reason=None):
await member.ban(reason=reason)
client.run(os.getenv('TOKEN'))