From 5b41aebb0037d0ad350646ad10c8f82ae9a0848c Mon Sep 17 00:00:00 2001 From: wlinator Date: Sun, 14 Jul 2024 12:12:15 -0400 Subject: [PATCH] Refactor rank command to use bridge.Context instead of commands.Context --- modules/levels/level.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/levels/level.py b/modules/levels/level.py index c64ded7..cbce16f 100644 --- a/modules/levels/level.py +++ b/modules/levels/level.py @@ -1,11 +1,14 @@ from discord import Embed -from discord.ext import commands +from discord.ext import bridge from lib.constants import CONST from lib.embed_builder import EmbedBuilder from services.xp_service import XpService -async def rank(ctx: commands.Context) -> None: +async def rank(ctx: bridge.Context) -> None: + if not ctx.guild: + return + xp_data: XpService = XpService(ctx.author.id, ctx.guild.id) rank: str = str(xp_data.calculate_rank())