Advertisement
Guest User

Untitled

a guest
Apr 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3.  
  4. client = commands.Bot(command_prefix='.')
  5.  
  6. ignore_members = []
  7.  
  8. @client.event
  9. async def on_ready():
  10. print('Logged in as')
  11. print(client.user.name)
  12. print(client.user.id)
  13. print('------')
  14.  
  15. @client.event
  16. async def on_message(message):
  17. if message.author.bot: return
  18.  
  19. await message.channel.send("{0.author} : {0.content}".format(message))
  20. await client.process_commands(message)
  21.  
  22. @client.event
  23. async def on_message_delete(message):
  24. if message.author.bot: return
  25. await message.channel.send("Deleted: {0.author} : {0.content}".format(message))
  26.  
  27. @client.event
  28. async def on_message_edit(before,after):
  29. if before.author.bot: return
  30. await before.channel.send("Edited: {} : from '{}' to '{}'".format(before.content,before.content,after.content))
  31.  
  32. @client.command()
  33. async def ping(ctx):
  34. await ctx.send("pong!")
  35.  
  36. @client.command()
  37. async def ignore(ctx):
  38. ignore_members.append(ctx.author)
  39. await ctx.send("{} your name added to ignore list.".format(ctx.author))
  40.  
  41. @client.command()
  42. async def ignorelist(ctx):
  43. await ctx.send(ignore_members)
  44.  
  45. @client.command()
  46. async def echo(ctx,*args):
  47.  
  48. output = ''
  49. for word in args[0:-1]:
  50. output += word
  51. output += ' '
  52.  
  53. for x in range(int(args[-1])):
  54. await ctx.send(output)
  55.  
  56. @client.command()
  57. async def calculate(ctx):
  58. await ctx.send("Result :")
  59.  
  60. client.run('NTY5NDQxMzM5MjM4OTA3OTE0.XLwruQ.0Kvgzt4gn8PdDF4MZy0Gvyhd1Fc')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement