diff --git a/shop/shop.py b/shop/shop.py index 7d3aa40..4b4d4c0 100644 --- a/shop/shop.py +++ b/shop/shop.py @@ -1495,14 +1495,20 @@ class ItemManager: return int(cost.content) def hierarchy_check(self, m): + # Extract role ID from mention if it's a mention + if m.role_mentions: + role = m.role_mentions[0] + if self.ctx.author == m.author: + if self.ctx.author.top_role >= role: + return True + return False + + # Regular role name check roles = [r.name for r in self.ctx.guild.roles if r.name != "Bot"] if self.ctx.author == m.author and m.content in roles: if self.ctx.author.top_role >= discord.utils.get(self.ctx.message.guild.roles, name=m.content): return True - else: - return False - else: - return False + return False async def set_role(self, item=None, shop=None): await self.ctx.send(