Skip to content

Commit

Permalink
allow only in guilds
Browse files Browse the repository at this point in the history
  • Loading branch information
LBlend committed Feb 22, 2023
1 parent 5297a59 commit 4cafcb1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cogs/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ async def force_user_rank_update(self, interaction: discord.Interaction):
# Defer because I suck at programming and this function takes a shit ton of time to run.
await interaction.response.defer()

if not interaction.guild:
return await interaction.followup.send(embed=embed_templates.error_warning('This command can only be used in a server'))

guild = await database.GuildTable().get(interaction.guild.id)
if (user := await database.UserTable().get(interaction.user.id)):
osu_user = await OsuApi.get_user(user.osu_id, Gamemode.from_id(user.gamemode))
Expand Down

0 comments on commit 4cafcb1

Please sign in to comment.