Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import asyncio
- import datetime as dt
- TOKEN = 'NTU3MjcyNDI1NzA4OTEyNjQw.D3GA5w.2gTWJaU8jM2e1zGuPfUlltYcdBE'
- client = discord.Client()
- @client.event
- async def on_message(message):
- # we do not want the bot to reply to itself
- if message.author == client.user:
- return
- if message.content.startswith('!hello'):
- msg = 'Hello {0.author.mention}'.format(message)
- await client.send_message(message.channel, msg)
- @asyncio.coroutine
- async def wait_for_time(message):
- if dt.datetime.now().hour == 21 and dt.datetime.now().minute == 34:
- msg = "I love you."
- await client.send_message(message.channel, msg)
- @client.event
- async def on_ready():
- print('Logged in as')
- print(client.user.name)
- print(client.user.id)
- print('------')
- client.run(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement