rewrite: Restructure to include GUI.

This commit is contained in:
2022-12-23 06:44:32 +02:00
parent 2b93354248
commit f328324747
224 changed files with 8 additions and 0 deletions

21
src/wards.py Normal file
View File

@@ -0,0 +1,21 @@
from meta.LionContext import LionContext
async def sys_admin(ctx: LionContext) -> bool:
"""
Checks whether the context author is listed in the configuration file as a bot admin.
"""
admins = ctx.bot.config.bot.getintlist('admins')
return ctx.author.id in admins
async def high_management(ctx: LionContext) -> bool:
if await sys_admin(ctx):
return True
if not ctx.guild:
return False
return ctx.author.guild_permissions.administrator
async def low_management(ctx: LionContext) -> bool:
return (await high_management(ctx)) or ctx.author.guild_permissions.manage_guild