daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Oct 10th, 2018 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import discord.py
  2. import asyncio
  3.  
  4. client = discord.Client()
  5.  
  6. @client.event
  7. async def on_ready():
  8.     print('Logged in as')
  9.     print(client.user.name)
  10.     print(client.user.id)
  11.     print('------')
  12.  
  13. @client.event
  14. async def on_message(message):
  15.     if message.content.startswith('!test'):
  16.         counter = 0
  17.         tmp = await client.send_message(message.channel, 'Calculating messages...')
  18.         async for log in client.logs_from(message.channel, limit=100):
  19.             if log.author == message.author:
  20.                 counter += 1
  21.  
  22.         await client.edit_message(tmp, 'You have {} messages.'.format(counter))
  23.     elif message.content.startswith('!sleep'):
  24.         await asyncio.sleep(5)
  25.         await client.send_message(message.channel, 'Done sleeping')
  26.  
  27. client.run("NDk5NjE3MzQzNzM2MTE5MzM0.Dp-96A.wLXMLp8f3rBU8KH6lQnaaslOjOY")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top