Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- import asyncio
- from discord.ext import commands
- client = discord.Client()
- client = commands.Bot(description='toxic', command_prefix='!', self_bot=True)
- client.remove_command('help')
- @client.event
- async def on_ready():
- print("Logged in as")
- print(client.user.name)
- print(client.user.id)
- print("--------")
- @client.command(invoke_without_command=True, aliases=['Help'])
- async def help(ctx):
- await ctx.channel.send('Commands:')
- await ctx.channel.send('Discord Cammands: ```!afk on/off```')
- @client.command(aliases=['AFK'])
- async def afk(ctx, options):
- if options == 'on':
- await ctx.message.delete()
- client.add_cog(afk(client))
- await ctx.channel.send('AFK: ON')
- elif options == 'off':
- donotanswer.clear()
- await ctx.message.delete()
- client.remove_cog('afk')
- await ctx.channel.send('AFK: OFF')
- donotanswer = []
- class afk(commands.Cog):
- @commands.Cog.listener()
- async def on_message(self, message):
- if message.author == client.user:
- return
- if message.author not in donotanswer:
- if not message.guild:
- donotanswer.append(message.author)
- await message.channel.send("Toxic is afk he will be back soon")
- if client.user.mentioned_in(message):
- donotanswer.append(message.author)
- await message.channel.send("Toxic is afk he will be back soon")
- @client.command(aliases=['Clear', 'clear'])
- async def clearafklog(ctx):
- await ctx.message.delete()
- donotanswer.clear()
- await ctx.channel.send('afk logs have been cleared')
- client.run('Token', bot = False)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement