feature (sponsors): Add sponsor command.
Add new sponsor prompts. Add new sponsor command. Add `sponsor_text` table. Add sponsor global config settings. Update `Setting.command` to use new `widget`. Add custom `cmd_str` support to `Message` `SettingType`.
This commit is contained in:
27
bot/modules/sponsors/module.py
Normal file
27
bot/modules/sponsors/module.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import discord
|
||||
|
||||
from LionModule import LionModule
|
||||
from LionContext import LionContext
|
||||
|
||||
from meta import client
|
||||
|
||||
from .config import settings
|
||||
|
||||
|
||||
module = LionModule("Sponsor")
|
||||
|
||||
|
||||
sponsored_commands = {'profile', 'stats', 'weekly', 'monthly'}
|
||||
|
||||
|
||||
@LionContext.reply.add_wrapper
|
||||
async def sponsor_reply_wrapper(func, ctx: LionContext, *args, **kwargs):
|
||||
if ctx.cmd and ctx.cmd.name in sponsored_commands:
|
||||
sponsor_hint = discord.Embed(
|
||||
description=settings.sponsor_prompt.value,
|
||||
colour=discord.Colour.dark_theme()
|
||||
)
|
||||
if 'embed' not in kwargs:
|
||||
kwargs['embed'] = sponsor_hint
|
||||
|
||||
return await func(ctx, *args, **kwargs)
|
||||
Reference in New Issue
Block a user