Last active
May 30, 2016 00:16
-
-
Save outout14/541c3dc274aa22fed655b079415eba47 to your computer and use it in GitHub Desktop.
Mon bot beugué
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
import asyncio | |
client = discord.Client() | |
@client.event | |
async def on_ready(): | |
print('Logged in as') | |
print(client.user.name) | |
print(client.user.id) | |
print('------') | |
client.accept_invite("https://discordapp.com/invite/0lNIJuCtcMkdtitC") | |
@client.event | |
async def on_message(message): | |
if message.content.startswith('!test'): | |
counter = 0 | |
tmp = await client.send_message(message.channel, 'Calculating messages...') | |
async for log in client.logs_from(message.channel, limit=100): | |
if log.author == message.author: | |
counter += 1 | |
await client.edit_message(tmp, 'You have {} messages.'.format(counter)) | |
elif message.content.startswith('!sleep'): | |
await asyncio.sleep(5) | |
await client.send_message(message.channel, 'Done sleeping') | |
client.run('MON TOKEN CORRECTE') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment