feat(topgg): Add voting prompt.
This commit is contained in:
@@ -538,6 +538,10 @@ class LeaderboardUI(StatsUI):
|
||||
page_row
|
||||
]
|
||||
|
||||
voting = self.bot.get_cog('TopggCog')
|
||||
if voting and not await voting.check_voted_recently(self.userid):
|
||||
self._layout.append((voting.vote_button(),))
|
||||
|
||||
async def reload(self):
|
||||
"""
|
||||
Reload UI data, applying cache where possible.
|
||||
|
||||
@@ -297,6 +297,10 @@ class ProfileUI(StatsUI):
|
||||
(self.stats_button, self.edit_button, self.close_button)
|
||||
]
|
||||
|
||||
voting = self.bot.get_cog('TopggCog')
|
||||
if voting and not await voting.check_voted_recently(self.userid):
|
||||
self._layout.append((voting.vote_button(),))
|
||||
|
||||
async def _render_stats(self):
|
||||
"""
|
||||
Create and render the profile card.
|
||||
|
||||
@@ -750,6 +750,11 @@ class WeeklyMonthlyUI(StatsUI):
|
||||
(self.type_menu,),
|
||||
(self.edit_button, self.select_button, self.global_button, self.close_button)
|
||||
]
|
||||
|
||||
voting = self.bot.get_cog('TopggCog')
|
||||
if voting and not await voting.check_voted_recently(self.userid):
|
||||
self._layout.append((voting.vote_button(),))
|
||||
|
||||
if self._showing_selector:
|
||||
await self.period_menu_refresh()
|
||||
self._layout.append((self.period_menu,))
|
||||
|
||||
Reference in New Issue
Block a user