Answer the question
In order to leave comments, you need to log in
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')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question