(core): Add app-global setting storage.
New `AppConfig` key-value table for arbitrary app config. New `KeyValueData` setting data mixin. New `AppSettings` settings group. Attached `AppSettings` as `client.settings`. Migrated sponsor settings to `AppSettings`.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
from cmdClient.checks import is_owner
|
||||
|
||||
from .module import module
|
||||
from .config import settings
|
||||
|
||||
|
||||
@module.cmd(
|
||||
@@ -18,10 +17,10 @@ async def cmd_sponsors(ctx, flags):
|
||||
if await is_owner.run(ctx) and any(flags.values()):
|
||||
if flags['edit']:
|
||||
# Run edit setting command
|
||||
await settings.sponsor_message.command(ctx, 0)
|
||||
await ctx.client.settings.sponsor_message.command(ctx, ctx.client.conf.bot['data_appid'])
|
||||
elif flags['prompt']:
|
||||
# Run prompt setting command
|
||||
await settings.sponsor_prompt.command(ctx, 0)
|
||||
await ctx.client.settings.sponsor_prompt.command(ctx, ctx.client.conf.bot['data_appid'])
|
||||
else:
|
||||
# Display message
|
||||
await ctx.reply(**settings.sponsor_message.args(ctx))
|
||||
await ctx.reply(**ctx.client.settings.sponsor_message.args(ctx))
|
||||
|
||||
Reference in New Issue
Block a user