(premium): Remove ad messages from premium guilds.

This commit is contained in:
2022-05-12 00:43:49 +03:00
parent 8c9e2e6cd8
commit 5be84facd3
2 changed files with 9 additions and 1 deletions

View File

@@ -16,7 +16,13 @@ sponsored_commands = {'profile', 'stats', 'weekly', 'monthly'}
async def sponsor_reply_wrapper(func, ctx: LionContext, *args, **kwargs): async def sponsor_reply_wrapper(func, ctx: LionContext, *args, **kwargs):
if ctx.cmd and ctx.cmd.name in sponsored_commands: if ctx.cmd and ctx.cmd.name in sponsored_commands:
if (prompt := ctx.client.settings.sponsor_prompt.value): if (prompt := ctx.client.settings.sponsor_prompt.value):
if not ctx.guild or ctx.guild.id not in ctx.client.settings.sponsor_guild_whitelist.value: if ctx.guild:
show = ctx.guild.id not in ctx.client.settings.sponsor_guild_whitelist.value
show = show and not ctx.client.data.premium_guilds.queries.fetch_guild(ctx.guild.id)
else:
show = True
if show:
sponsor_hint = discord.Embed( sponsor_hint = discord.Embed(
description=prompt, description=prompt,
colour=discord.Colour.dark_theme() colour=discord.Colour.dark_theme()

View File

@@ -47,6 +47,8 @@ async def topgg_reply_wrapper(func, ctx: LionContext, *args, suggest_vote=True,
pass pass
elif ctx.guild and ctx.guild.id in ctx.client.settings.topgg_guild_whitelist.value: elif ctx.guild and ctx.guild.id in ctx.client.settings.topgg_guild_whitelist.value:
pass pass
elif ctx.guild and ctx.client.data.premium_guilds.queries.fetch_guild(ctx.guild.id):
pass
elif not get_last_voted_timestamp(ctx.author.id): elif not get_last_voted_timestamp(ctx.author.id):
upvote_info_formatted = upvote_info.format(lion_yayemote, ctx.best_prefix, lion_loveemote) upvote_info_formatted = upvote_info.format(lion_yayemote, ctx.best_prefix, lion_loveemote)