Skip to content

Commit e04347c

Browse files
committed
Fix auth required decorator for update comamnd
1 parent b8b204f commit e04347c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

core/decorators.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ async def wrapper(self, ctx, *args, **kwargs):
1515
def auth_required(func):
1616
@functools.wraps(func)
1717
async def wrapper(self, ctx, *args, **kwargs):
18-
if self.bot.config.get('modmail_api_token'):
18+
if self.bot.selfhosting and self.bot.config.get('github_access_token') or self.bot.config.get('modmail_api_token'):
1919
return await func(self, ctx, *args, **kwargs)
20+
21+
2022
em = discord.Embed(
2123
color=discord.Color.red(),
2224
title='Unauthorized',
23-
description='You can only use this command if you have a configured `MODMAIL_API_TOKEN`. Get your token from https://dashboard.modmail.tk'
25+
description='You can only use this command if you have a configured `MODMAIL_API_TOKEN`. Get your token from https://dashboard.modmail.tk' if not self.bot.selfhosting else 'You can only use this command if you have a configured `GITHUB_ACCESS_TOKEN`. Get a personal access token from developer settings.'
2426
)
2527
await ctx.send(embed=em)
2628
return wrapper

0 commit comments

Comments
 (0)