Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import discord
  2. import asyncio
  3.  
  4. import datetime as dt
  5.  
  6. TOKEN = 'NTU3MjcyNDI1NzA4OTEyNjQw.D3GA5w.2gTWJaU8jM2e1zGuPfUlltYcdBE'
  7.  
  8. client = discord.Client()
  9.  
  10.  
  11. @client.event
  12. async def on_message(message):
  13. # we do not want the bot to reply to itself
  14. if message.author == client.user:
  15. return
  16.  
  17. if message.content.startswith('!hello'):
  18. msg = 'Hello {0.author.mention}'.format(message)
  19. await client.send_message(message.channel, msg)
  20.  
  21.  
  22.  
  23. @asyncio.coroutine
  24. async def wait_for_time(message):
  25. if dt.datetime.now().hour == 21 and dt.datetime.now().minute == 34:
  26. msg = "I love you."
  27. await client.send_message(message.channel, msg)
  28.  
  29.  
  30. @client.event
  31. async def on_ready():
  32. print('Logged in as')
  33. print(client.user.name)
  34. print(client.user.id)
  35. print('------')
  36.  
  37. client.run(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement