S
S
stepanlll2021-12-22 19:11:59
Python
stepanlll, 2021-12-22 19:11:59

python discord.py error affecting python files, how to solve?

I’m trying to make a bot in the discord, everything worked exactly until the moment I decided to do auto-filtering for insults
, at first the filtering didn’t work, and now the bot doesn’t turn on
the full code at all

import discord
from discord.ext import commands


client = commands.Bot( command_prefix = '!' )

#Mute

@client.command( pass_context = True )

async def hello( ctx ):
  author = ctx.message.author
  await ctx.send( f'Self-Distruction activated. Please, wait... { author.mention }' )

# event

@client.event

async def on_ready():
  print( 'MetroBot connected' )

@client.event

async def on_message( message, ctx ):
  insult_words = [ тут список матюков ]
  msg = message.content.lower()
  if msg in insult_words:
    if context.message.author.server_premission.administrator:

         await message.channel.send( f'{ author.mention } you are an administrator but please do not insult' )
    else:
      await message.channel.send( f'you has been muted on 15 sec for insult message:' + arg )



client.run('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')

crashes with such an error
, if anything, I haven’t done it yet61c34ddf31d97013565511.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-12-22
@stepanlll

on_meassage takes only one argument - message. You have two

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question