Skip to content

Commit a918087

Browse files
committed
[personalroles] fix checks that causes help to fail
1 parent 6ce4b8f commit a918087

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

personalroles/personalroles.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,23 @@
2626

2727
async def has_assigned_role(ctx):
2828
"""Check if user has assigned role"""
29+
if not ctx.guild:
30+
return False
2931
return ctx.guild.get_role(await ctx.cog.config.member(ctx.author).role())
3032

3133

3234
async def role_icons_feature(ctx):
3335
"""Check for ROLE_ICONS feature"""
36+
if not ctx.guild:
37+
return False
3438
return "ROLE_ICONS" in ctx.guild.features
3539

3640

3741
@cog_i18n(_)
3842
class PersonalRoles(commands.Cog):
3943
"""Assign and edit personal roles"""
4044

41-
__version__ = "2.2.4"
45+
__version__ = "2.2.5"
4246

4347
# noinspection PyMissingConstructor
4448
def __init__(self, bot):

0 commit comments

Comments
 (0)