12
12
from discord .enums import ActivityType
13
13
from discord .ext import commands
14
14
15
+ from core import checks
15
16
from core .changelog import ChangeLog
16
- from core .decorators import auth_required , owner_only , trigger_typing
17
+ from core .decorators import github_access_token_required , trigger_typing
17
18
from core .models import Bot
18
19
from core .paginator import PaginatorSession
19
20
from core .utils import cleanup_code
@@ -190,8 +191,8 @@ async def about(self, ctx):
190
191
await ctx .send (embed = embed )
191
192
192
193
@commands .command ()
193
- @owner_only ()
194
- @auth_required
194
+ @commands . is_owner ()
195
+ @github_access_token_required
195
196
@trigger_typing
196
197
async def github (self , ctx ):
197
198
"""Shows the github user your access token is linked to."""
@@ -213,8 +214,8 @@ async def github(self, ctx):
213
214
await ctx .send (embed = embed )
214
215
215
216
@commands .command ()
216
- @owner_only ()
217
- @auth_required
217
+ @commands . is_owner ()
218
+ @github_access_token_required
218
219
@trigger_typing
219
220
async def update (self , ctx ):
220
221
"""Updates the bot, this only works with heroku users."""
@@ -269,7 +270,7 @@ async def update(self, ctx):
269
270
return await ctx .send (embed = embed )
270
271
271
272
@commands .command (aliases = ['presence' ])
272
- @commands .has_permissions (administrator = True )
273
+ @checks .has_permissions (administrator = True )
273
274
async def activity (self , ctx , activity_type : str , * , message : str = '' ):
274
275
"""
275
276
Set a custom activity for the bot.
@@ -339,7 +340,7 @@ async def activity(self, ctx, activity_type: str, *, message: str = ''):
339
340
340
341
@commands .command ()
341
342
@trigger_typing
342
- @commands .has_permissions (administrator = True )
343
+ @checks .has_permissions (administrator = True )
343
344
async def ping (self , ctx ):
344
345
"""Pong! Returns your websocket latency."""
345
346
embed = Embed (
@@ -350,7 +351,7 @@ async def ping(self, ctx):
350
351
return await ctx .send (embed = embed )
351
352
352
353
@commands .command ()
353
- @commands .has_permissions (administrator = True )
354
+ @checks .has_permissions (administrator = True )
354
355
async def mention (self , ctx , * , mention = None ):
355
356
"""Changes what the bot mentions at the start of each thread."""
356
357
current = self .bot .config .get ('mention' , '@here' )
@@ -374,7 +375,7 @@ async def mention(self, ctx, *, mention=None):
374
375
return await ctx .send (embed = embed )
375
376
376
377
@commands .command ()
377
- @commands .has_permissions (administrator = True )
378
+ @checks .has_permissions (administrator = True )
378
379
async def prefix (self , ctx , * , prefix = None ):
379
380
"""Changes the prefix for the bot."""
380
381
@@ -395,7 +396,7 @@ async def prefix(self, ctx, *, prefix=None):
395
396
await ctx .send (embed = embed )
396
397
397
398
@commands .group ()
398
- @owner_only ()
399
+ @commands . is_owner ()
399
400
async def config (self , ctx ):
400
401
"""Change config vars for the bot."""
401
402
@@ -506,7 +507,7 @@ async def get(self, ctx, key=None):
506
507
return await ctx .send (embed = embed )
507
508
508
509
@commands .group (aliases = ['aliases' ])
509
- @commands .has_permissions (manage_messages = True )
510
+ @checks .has_permissions (manage_messages = True )
510
511
async def alias (self , ctx ):
511
512
"""Returns a list of aliases that are currently set."""
512
513
if ctx .invoked_subcommand is not None :
@@ -606,7 +607,7 @@ async def del_alias(self, ctx, *, name: str.lower):
606
607
return await ctx .send (embed = embed )
607
608
608
609
@commands .command (hidden = True , name = 'eval' )
609
- @owner_only ()
610
+ @commands . is_owner ()
610
611
async def eval_ (self , ctx , * , body ):
611
612
"""Evaluates Python code"""
612
613
0 commit comments