Advertisement
nottoxic

afk selfbot discord

May 20th, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. import discord
  2. import asyncio
  3. from discord.ext import commands
  4.  
  5.  
  6. client = discord.Client()
  7. client = commands.Bot(description='toxic', command_prefix='!', self_bot=True)
  8. client.remove_command('help')
  9.  
  10. @client.event
  11. async def on_ready():
  12. print("Logged in as")
  13. print(client.user.name)
  14. print(client.user.id)
  15. print("--------")
  16.  
  17. @client.command(invoke_without_command=True, aliases=['Help'])
  18. async def help(ctx):
  19. await ctx.channel.send('Commands:')
  20. await ctx.channel.send('Discord Cammands: ```!afk on/off```')
  21.  
  22. @client.command(aliases=['AFK'])
  23. async def afk(ctx, options):
  24. if options == 'on':
  25. await ctx.message.delete()
  26. client.add_cog(afk(client))
  27. await ctx.channel.send('AFK: ON')
  28. elif options == 'off':
  29. donotanswer.clear()
  30. await ctx.message.delete()
  31. client.remove_cog('afk')
  32. await ctx.channel.send('AFK: OFF')
  33. donotanswer = []
  34. class afk(commands.Cog):
  35. @commands.Cog.listener()
  36. async def on_message(self, message):
  37. if message.author == client.user:
  38. return
  39. if message.author not in donotanswer:
  40. if not message.guild:
  41. donotanswer.append(message.author)
  42. await message.channel.send("Toxic is afk he will be back soon")
  43. if client.user.mentioned_in(message):
  44. donotanswer.append(message.author)
  45. await message.channel.send("Toxic is afk he will be back soon")
  46. @client.command(aliases=['Clear', 'clear'])
  47. async def clearafklog(ctx):
  48. await ctx.message.delete()
  49. donotanswer.clear()
  50. await ctx.channel.send('afk logs have been cleared')
  51.  
  52.  
  53.  
  54. client.run('Token', bot = False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement