From c463f7bd4e53714f27764bcac9c0d6de3ad01a6f Mon Sep 17 00:00:00 2001 From: Milka64 Date: Tue, 1 Oct 2019 15:35:32 +0200 Subject: [PATCH] clean code --- kabot/kabot/kabot.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/kabot/kabot/kabot.py b/kabot/kabot/kabot.py index fd2f019..6404603 100644 --- a/kabot/kabot/kabot.py +++ b/kabot/kabot/kabot.py @@ -53,30 +53,6 @@ class Mybot(commands.Cog): await ctx.send(response) - async def on_message(self, message): - print(message.content) - if message.author == self.user: - return - if message.content.startswith('!') and not message.content.startswith('!on_'): - try: - print('self.' + message.content[1:] + '(message)') - await eval('self.' + message.content[1:] + '(message)') - except: - await message.channel.send("%s ? Ouais, c'est pas faux !" % message.content[1:]) - if message.content == 'pwet': - await message.channel.send('pong') - else: - if self.user in message.mentions and len(message.mentions) < 3: - path = '/tmp/%s.log' % message.channel - with open(path, 'r') as f : - lines = f.read().splitlines() - with open(path, 'a') as f : - f.write(message.content + '\n') - response = random.choice(lines).replace(str(self.user.id), str(message.author.id)) - await message.channel.send(response) - - return - def main(): token = "NjI3MTM3NDY1MDA5ODMxOTQ2.XY4Raw.pw8sAen3bNR5aYsoTChQOudM0L8" bot = commands.Bot(command_prefix='!')