diff --git a/frost.py b/frost.py index 5325c3f..7997b5c 100644 --- a/frost.py +++ b/frost.py @@ -9,17 +9,17 @@ @client.event async def on_ready(): - print('Logged in as '+client.user.name+' (ID:'+client.user.id+') | '+str(len(client.servers))+' servers') + print('Logged in as '+client.user.name+' (ID:'+str(client.user.id)+') | '+str(len(client.guilds))+' servers') await client.change_presence(game=discord.Game(name='chat with me!')) @client.event async def on_message(message): - if not message.author.bot and (message.server == None or client.user in message.mentions): - await client.send_typing(message.channel) - txt = message.content.replace(message.server.me.mention,'') if message.server else message.content + if not message.author.bot and (message.guild == None or client.user in message.mentions): + await message.channel.trigger_typing() + txt = message.content.replace(message.guild.me.mention,'') if message.guild else message.content r = json.loads(requests.post('https://cleverbot.io/1.0/ask', json={'user':user, 'key':key, 'nick':'frost', 'text':txt}).text) if r['status'] == 'success': - await client.send_message(message.channel, r['response'] ) + await message.channel.send(r['response'] ) print('Starting...') requests.post('https://cleverbot.io/1.0/create', json={'user':user, 'key':key, 'nick':'frost'})