I'm new to python and have taken on the task of creating a discord bot. Everything is going well, except for the function to kick the participant out. The code doesn't work because this function has no state and data arguments. I would be very grateful if someone could help.
import discord
from discord.ext import commands
config = {
'prefix': '.',
}
intents = discord.Intents().all()
bot = commands.Bot(command_prefix=config['prefix'], intents=intents)
@bot.event
async def on_member_join(member):
await member.send('Привет! Добро пожаловать на наш сервер!')
@bot.command
async def kick(ctx, user : discord.User(), *arg, reason='Причина не указана'):
await bot.kick(user)
await ctx.send('Участник {user.name} был изгнан из сервера по причине "{reason}"')
bot.run(config['token'])
This is error that python returns:
Traceback (most recent call last):
File "d:\Python\Projects\Discord\Revanius\main.py", line 20, in <module>
async def kick(ctx, user : discord.User(), *arg, reason='Причина не указана'):
TypeError: BaseUser.__init__() missing 2 required keyword-only arguments: 'state' and 'data'
PS D:\Python\Projects\Discord\Revanius>
Help me please!