feat(premium): Ad-whitelist premium guilds.
This commit is contained in:
@@ -36,9 +36,13 @@ class SponsorCog(LionCog):
|
|||||||
"""
|
"""
|
||||||
if not interaction.is_expired():
|
if not interaction.is_expired():
|
||||||
# TODO: caching
|
# TODO: caching
|
||||||
whitelist = (await self.settings.Whitelist.get(self.bot.appname)).value
|
if interaction.guild:
|
||||||
if interaction.guild and interaction.guild.id in whitelist:
|
whitelist = (await self.settings.Whitelist.get(self.bot.appname)).value
|
||||||
return
|
if interaction.guild.id in whitelist:
|
||||||
|
return
|
||||||
|
premiumcog = self.bot.get_cog('PremiumCog')
|
||||||
|
if premiumcog and await premiumcog.is_premium_guild(interaction.guild.id):
|
||||||
|
return
|
||||||
setting = await self.settings.SponsorPrompt.get(self.bot.appname)
|
setting = await self.settings.SponsorPrompt.get(self.bot.appname)
|
||||||
value = setting.value
|
value = setting.value
|
||||||
if value:
|
if value:
|
||||||
|
|||||||
@@ -537,10 +537,11 @@ class LeaderboardUI(StatsUI):
|
|||||||
period_row,
|
period_row,
|
||||||
page_row
|
page_row
|
||||||
]
|
]
|
||||||
|
|
||||||
voting = self.bot.get_cog('TopggCog')
|
voting = self.bot.get_cog('TopggCog')
|
||||||
if voting and not await voting.check_voted_recently(self.userid):
|
if voting and not await voting.check_voted_recently(self.userid):
|
||||||
self._layout.append((voting.vote_button(),))
|
premiumcog = self.bot.get_cog('PremiumCog')
|
||||||
|
if not (premiumcog and await premiumcog.is_premium_guild(self.guild.id)):
|
||||||
|
self._layout.append((voting.vote_button(),))
|
||||||
|
|
||||||
async def reload(self):
|
async def reload(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -299,7 +299,9 @@ class ProfileUI(StatsUI):
|
|||||||
|
|
||||||
voting = self.bot.get_cog('TopggCog')
|
voting = self.bot.get_cog('TopggCog')
|
||||||
if voting and not await voting.check_voted_recently(self.userid):
|
if voting and not await voting.check_voted_recently(self.userid):
|
||||||
self._layout.append((voting.vote_button(),))
|
premiumcog = self.bot.get_cog('PremiumCog')
|
||||||
|
if not (premiumcog and await premiumcog.is_premium_guild(self.guild.id)):
|
||||||
|
self._layout.append((voting.vote_button(),))
|
||||||
|
|
||||||
async def _render_stats(self):
|
async def _render_stats(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -753,7 +753,9 @@ class WeeklyMonthlyUI(StatsUI):
|
|||||||
|
|
||||||
voting = self.bot.get_cog('TopggCog')
|
voting = self.bot.get_cog('TopggCog')
|
||||||
if voting and not await voting.check_voted_recently(self.userid):
|
if voting and not await voting.check_voted_recently(self.userid):
|
||||||
self._layout.append((voting.vote_button(),))
|
premiumcog = self.bot.get_cog('PremiumCog')
|
||||||
|
if not (premiumcog and await premiumcog.is_premium_guild(self.guild.id)):
|
||||||
|
self._layout.append((voting.vote_button(),))
|
||||||
|
|
||||||
if self._showing_selector:
|
if self._showing_selector:
|
||||||
await self.period_menu_refresh()
|
await self.period_menu_refresh()
|
||||||
|
|||||||
Reference in New Issue
Block a user