Change decorator which checks for owner
Add is_me decorator to checks.py
This commit is contained in:
parent
76a4a753c4
commit
1e44728980
@ -66,6 +66,8 @@ logger.info(f'Misc Libs Import Complete - Took {(datetime.utcnow() - start).tota
|
|||||||
# from geeksbot.imports import message_logging
|
# from geeksbot.imports import message_logging
|
||||||
# logger.info(f'Geeksbot Libs Import Complete - Took {(datetime.utcnow() - start).total_seconds()} seconds')
|
# logger.info(f'Geeksbot Libs Import Complete - Took {(datetime.utcnow() - start).total_seconds()} seconds')
|
||||||
|
|
||||||
|
from geeksbot.imports.checks import is_me
|
||||||
|
|
||||||
|
|
||||||
logger.info('Imports Complete')
|
logger.info('Imports Complete')
|
||||||
|
|
||||||
@ -94,6 +96,7 @@ class Geeksbot(commands.Bot):
|
|||||||
self.geo_api = '2d4e419c2be04c8abe91cb5dd1548c72'
|
self.geo_api = '2d4e419c2be04c8abe91cb5dd1548c72'
|
||||||
self.git_url = 'https://github.com/dustinpianalto/geeksbot_v2'
|
self.git_url = 'https://github.com/dustinpianalto/geeksbot_v2'
|
||||||
self.load_default_extensions()
|
self.load_default_extensions()
|
||||||
|
self.owner_id = 351794468870946827
|
||||||
|
|
||||||
self.book_emojis = {
|
self.book_emojis = {
|
||||||
'unlock': '🔓',
|
'unlock': '🔓',
|
||||||
@ -125,8 +128,8 @@ class Geeksbot(commands.Bot):
|
|||||||
bot = Geeksbot(case_insensitive=True)
|
bot = Geeksbot(case_insensitive=True)
|
||||||
|
|
||||||
|
|
||||||
|
@is_me()
|
||||||
@bot.command(hidden=True)
|
@bot.command(hidden=True)
|
||||||
@commands.is_owner()
|
|
||||||
async def load(ctx, mod=None):
|
async def load(ctx, mod=None):
|
||||||
"""Allows the owner to load extensions dynamically"""
|
"""Allows the owner to load extensions dynamically"""
|
||||||
logger.info(f"Starting to load {mod}")
|
logger.info(f"Starting to load {mod}")
|
||||||
@ -135,8 +138,8 @@ async def load(ctx, mod=None):
|
|||||||
logger.info(f"{mod} loaded")
|
logger.info(f"{mod} loaded")
|
||||||
|
|
||||||
|
|
||||||
|
@is_me()
|
||||||
@bot.command(hidden=True)
|
@bot.command(hidden=True)
|
||||||
@commands.is_owner()
|
|
||||||
async def reload(ctx, mod=None):
|
async def reload(ctx, mod=None):
|
||||||
"""Allows the owner to reload extensions dynamically"""
|
"""Allows the owner to reload extensions dynamically"""
|
||||||
if mod == 'all':
|
if mod == 'all':
|
||||||
@ -151,8 +154,8 @@ async def reload(ctx, mod=None):
|
|||||||
await ctx.send(f'{mod} reloaded')
|
await ctx.send(f'{mod} reloaded')
|
||||||
|
|
||||||
|
|
||||||
|
@is_me()
|
||||||
@bot.command(hidden=True)
|
@bot.command(hidden=True)
|
||||||
@commands.is_owner()
|
|
||||||
async def unload(ctx, mod):
|
async def unload(ctx, mod):
|
||||||
"""Allows the owner to unload extensions dynamically"""
|
"""Allows the owner to unload extensions dynamically"""
|
||||||
logger.info(f"Starting to unload {mod}")
|
logger.info(f"Starting to unload {mod}")
|
||||||
|
|||||||
@ -1,4 +1,7 @@
|
|||||||
import discord
|
import discord
|
||||||
|
|
||||||
def is_rcon_admin(bot, ctx):
|
|
||||||
|
|
||||||
|
def is_me():
|
||||||
|
def predicate(ctx):
|
||||||
|
return ctx.message.author.id == ctx.bot.owner_id
|
||||||
|
return discord.ext.commands.check(predicate)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user