(topgg): Whitelisting groups and commands.
This commit is contained in:
@@ -16,6 +16,7 @@ async def attach_topgg_webhook(client):
|
|||||||
init_webhook()
|
init_webhook()
|
||||||
client.log("Attached top.gg voiting webhook.", context="TOPGG")
|
client.log("Attached top.gg voiting webhook.", context="TOPGG")
|
||||||
|
|
||||||
|
|
||||||
@module.launch_task
|
@module.launch_task
|
||||||
async def register_hook(client):
|
async def register_hook(client):
|
||||||
LionContext.reply.add_wrapper(topgg_reply_wrapper)
|
LionContext.reply.add_wrapper(topgg_reply_wrapper)
|
||||||
@@ -31,13 +32,14 @@ async def unregister_hook(client):
|
|||||||
|
|
||||||
client.log("Unloaded top.gg hooks.", context="TOPGG")
|
client.log("Unloaded top.gg hooks.", context="TOPGG")
|
||||||
|
|
||||||
|
boostfree_groups = {'Meta'}
|
||||||
|
boostfree_commands = {'config', 'pomodoro'}
|
||||||
|
|
||||||
|
|
||||||
async def topgg_reply_wrapper(func, ctx: LionContext, *args, suggest_vote=True, **kwargs):
|
async def topgg_reply_wrapper(func, ctx: LionContext, *args, suggest_vote=True, **kwargs):
|
||||||
if not suggest_vote:
|
if not suggest_vote:
|
||||||
pass
|
pass
|
||||||
elif ctx.cmd and ctx.cmd.name == 'config':
|
elif ctx.cmd and (ctx.cmd.name in boostfree_commands or ctx.cmd.group in boostfree_groups):
|
||||||
pass
|
|
||||||
elif ctx.cmd and ctx.cmd.name == 'help' and ctx.args and ctx.args.split(maxsplit=1)[0].lower() == 'vote':
|
|
||||||
pass
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user