fix(core): Handle rendering errors.

This commit is contained in:
2023-09-19 22:59:01 +03:00
parent c63027f20e
commit 17683a7d96
7 changed files with 83 additions and 47 deletions

View File

@@ -299,42 +299,42 @@ class LeaderboardUI(StatsUI):
@button(label="This Season", style=ButtonStyle.grey)
async def season_button(self, press: discord.Interaction, pressed: Button):
await press.response.defer(thinking=True)
await press.response.defer(thinking=True, ephemeral=True)
self.current_period = LBPeriod.SEASON
self.focused = True
await self.refresh(thinking=press)
@button(label="Today", style=ButtonStyle.grey)
async def day_button(self, press: discord.Interaction, pressed: Button):
await press.response.defer(thinking=True)
await press.response.defer(thinking=True, ephemeral=True)
self.current_period = LBPeriod.DAY
self.focused = True
await self.refresh(thinking=press)
@button(label="This Week", style=ButtonStyle.grey)
async def week_button(self, press: discord.Interaction, pressed: Button):
await press.response.defer(thinking=True)
await press.response.defer(thinking=True, ephemeral=True)
self.current_period = LBPeriod.WEEK
self.focused = True
await self.refresh(thinking=press)
@button(label="This Month", style=ButtonStyle.grey)
async def month_button(self, press: discord.Interaction, pressed: Button):
await press.response.defer(thinking=True)
await press.response.defer(thinking=True, ephemeral=True)
self.current_period = LBPeriod.MONTH
self.focused = True
await self.refresh(thinking=press)
@button(label="All Time", style=ButtonStyle.grey)
async def alltime_button(self, press: discord.Interaction, pressed: Button):
await press.response.defer(thinking=True)
await press.response.defer(thinking=True, ephemeral=True)
self.current_period = LBPeriod.ALLTIME
self.focused = True
await self.refresh(thinking=press)
@button(emoji=conf.emojis.backward, style=ButtonStyle.grey)
async def prev_button(self, press: discord.Interaction, pressed: Button):
await press.response.defer(thinking=True)
await press.response.defer(thinking=True, ephemeral=True)
self.pagen -= 1
self.focused = False
await self.refresh(thinking=press)