Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import discord
  2. from discord.ext.commands import Bot
  3. from discord.ext import commands
  4. import asyncio
  5. import time
  6.  
  7.  
  8. Client = discord.Client()
  9. client = commands.Bot(command_prefix = "!")
  10.  
  11.  
  12. @client.event
  13. async def on_ready():
  14. print("Il BOT è connesso a Discord!")
  15.  
  16.  
  17. @client.event
  18. async def on_message(message):
  19. if message.content.upper().startswith('!PING'):
  20. userID = message.author.id
  21. await client.send_message(message.channel, "<@%s> Pong!" % (userID))
  22. if message.content.upper().startswith('!SAY'):
  23. if message.author.id == "id(i insert after)":
  24. args = message.content.split(" ")
  25. await client.send_message(message.channel, "%s" % (" ".join(args[1:])))
  26. else:
  27. await client.send_message(message.channel, "Non hai il permesso per eseguire questo comando.")
  28.  
  29.  
  30.  
  31. client.run("key(i insert after)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement