Skip to content

Commit

Permalink
added Check Function for Commands
Browse files Browse the repository at this point in the history
- Check Functions are Admin/Server Permissions (Use it on your Own Risk!)
  • Loading branch information
Shinyhunter2109 authored Jul 28, 2020
1 parent 571bf63 commit 5af13b5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Discord-Bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
handler.setFormatter(logging.Formatter('%(asctime)s:%(levelname)s:%(name)s: %(message)s'))
logger.addHandler(handler)

client = commands.Bot(command_prefix = '!')
client = commands.Bot(command_prefix = '.')
client.remove_command('help')
status = cycle(['Shiny Pokémon Wondertrades', 'GTS Moveset Help'])
ROLE = 'INSERT ROLE HERE...'
Expand Down Expand Up @@ -794,9 +794,14 @@ async def _8Ball(ctx, *, question):
'Outlook not so good.',
'Very doubtful.']
await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}')


def is_it_me(ctx):
return ctx.author.id ==Insert Your Discord-ID Here


@client.command()
@commands.check(is_it_me)
async def clear(ctx, amount=100):
await ctx.channel.purge(limit=amount)
await ctx.send(f'Channel Clear Successfully done!')
Expand All @@ -813,4 +818,4 @@ async def on_member_join(member):
async def on_member_remove(member):
print(f'{member} has left the server.')

client.run(TOKEN)
client.run(TOKEN)

0 comments on commit 5af13b5

Please sign in to comment.