Skip to content

Commit d661bd4

Browse files
committed
Use set for is_owner
1 parent f495e45 commit d661bd4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

bot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ def _load_extensions(self):
130130
self.load_extension(cog)
131131

132132
async def is_owner(self, user):
133-
allowed = [int(x) for x in str(self.config.get('owners', '0')).split(',')]
133+
allowed = {int(x) for x in
134+
str(self.config.get('owners', '0')).split(',')}
134135
return user.id in allowed
135136

136137
async def logout(self):

core/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ async def wrapper(self, ctx: commands.Context, *args, **kwargs):
3939

4040
def owner_only():
4141
async def predicate(ctx: commands.Context) -> bool:
42-
allowed = [int(x) for x in
43-
str(ctx.bot.config.get('owners', '0')).split(',')]
42+
allowed = {int(x) for x in
43+
str(ctx.bot.config.get('owners', '0')).split(',')}
4444
return ctx.author.id in allowed
4545

4646
return commands.check(predicate)

0 commit comments

Comments
 (0)