Advertisement
pedroricardo

TUTOR PYTHON #3

Jan 3rd, 2018
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. import discord
  2. import asyncio
  3. import random
  4.  
  5. client = discord.Client()
  6.  
  7.  
  8. @client.event
  9. async def on_ready():
  10.    print('BOT ONLINE - Olá Mundo!')
  11.    print(client.user.name)
  12.    print(client.user.id)
  13.    print('--------PR-------')
  14.  
  15.  
  16. @client.event
  17. async def on_message(message):
  18.     if message.content.lower().startswith('?test'):
  19.         await client.send_message(message.channel, "Olá Mundo, estou vivo.")
  20.  
  21.     if message.content.lower().startswith('?coin'):
  22.       if message.author.id == "id":
  23.         choice = random.randint(1, 2)
  24.         if choice == 1:
  25.             await client.add_reaction(message, '😀')
  26.         if choice == 2:
  27.             await client.add_reaction(message, '👑')
  28.       else:
  29.           await client.send_message(message.channel, "Você não tem permissão para usar este comando!")
  30.  
  31.  
  32. client.run('TOKEN')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement