Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. import discord
  2. import asyncio
  3. import random
  4. import secreto
  5.  
  6. client = discord.Client()
  7.  
  8. COR =0xA97FD6
  9. TOKEN = secreto.seu_token()
  10. msg_id = None
  11. msg_user = None
  12.  
  13. @client.event
  14. async def on_ready():
  15. print('BOT ONLINE - Olá Mundo!')
  16. print(client.user.name)
  17. print(client.user.id)
  18. print('---------PR-------')
  19.  
  20. @client.event
  21. async def on_message(message):
  22. if message.content.lower().startswith('?test'):
  23. await client.send_message(message.channel, "Olá Mundo!")
  24.  
  25. if message.content.lower().startswith('!moeda'):
  26. choice = random.randint(1,2)
  27. if choice == 1:
  28. await client.add_reaction(message, '😁')
  29. if choice == 2:
  30. await client.add_reaction(message, '👑')
  31.  
  32. if message.content.lower().startswith("?lol"):
  33. embed = discord.Embed(
  34. tittle="Vereficação",
  35. color=COR,
  36. description="- Vereficar =✔\n"
  37. "- Vereficar só uma vez!⛔",
  38.  
  39.  
  40. )
  41.  
  42. botmsg = await client.send_message(message.channel,embed=embed)
  43. await client.add_reaction(botmsg, "✔")
  44.  
  45. global msg_id
  46. msg_id = botmsg.id
  47. global msg_user
  48. msg_user = message.author
  49.  
  50. @client.event
  51. async def on_reaction_add(reaction, user):
  52. msg = reaction.message
  53.  
  54. if reaction.emoji == "✔" and msg.id == msg_id:
  55. role = discord.utils.find(lambda r: r.name == "civil", msg.server.roles)
  56. await client.add_roles(user, role)
  57. print("add")
  58.  
  59. if reaction.emoji == "✔" and msg.id == msg_id:
  60. role = discord.utils.find(lambda r: r.name == "Não Vereficado", msg.server.roles)
  61. await client.remove_roles(user, role)
  62. print("remove")
  63.  
  64. @client.event
  65. async def on_reaction_remove(reaction, user):
  66. msg = reaction.message
  67.  
  68. if reaction.emoji == "✔" and msg.id == msg.id:
  69. role = discord.utils.find(lambda r: r.name == "civil", msg.server.roles)
  70. await client.remove_roles(user, role)
  71. print("remove")
  72.  
  73. if reaction.emoji == "✔" and msg.id == msg.id:
  74. role = discord.utils.find(lambda r: r.name == "Não Vereficado", msg.server.roles)
  75. await client.add_roles(user, role)
  76. print("add")
  77.  
  78.  
  79.  
  80. client.run(TOKEN)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement