Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import discord
  2. from discord.ext.commands import Bot
  3. from discord.ext import commands
  4. import asyncio
  5. from time import sleep
  6. prefix = "!"
  7. token = "authorization token herer"
  8. bot = commands.Bot(command_prefix=prefix, self_bot=True)
  9. bot.remove_command("help")
  10.  
  11. @bot.event
  12. async def on_ready():
  13. print ("Yup im online my meister")
  14. print ("Name: {}".format(bot.user.name))
  15. print ("ID: {}".format(bot.user.id))
  16.  
  17. @bot.command(pass_context=True)
  18. async def clear(ctx, limit: int=None):
  19. async for msg in bot.logs_from(ctx.message.channel, limit=limit):
  20. if msg.author.id == bot.user.id:
  21. try:
  22. await bot.delete_message (msg)
  23. except:
  24. pass
  25. embed = discord.Embed(description="Action completed! :smile:", color=0x00ff00)
  26. #await bot.say(embed=embed)
  27.  
  28. bot.run(token, bot=False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement