clean code
This commit is contained in:
parent
2c507fd041
commit
c463f7bd4e
1 changed files with 0 additions and 24 deletions
|
@ -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='!')
|
||||
|
|
Loading…
Reference in a new issue