feat(logger): added the cog
This commit is contained in:
parent
09ab8aa69d
commit
1a26d82c36
5 changed files with 208 additions and 0 deletions
30
logger/menu.py
Normal file
30
logger/menu.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
|
||||
from discord import Embed, Message, ui
|
||||
from redbot.core import commands
|
||||
|
||||
from .config import config
|
||||
|
||||
|
||||
async def get_config(ctx: commands.Context) -> dict:
|
||||
return dict(sorted(await config.guild(ctx.guild).all().items()))
|
||||
|
||||
async def get_embed(ctx: commands.Context, type: str = None):
|
||||
conf = await get_config(ctx)
|
||||
if not type or type not in conf.keys():
|
||||
embed = Embed(
|
||||
title="Logger Configuration - Message Delete",
|
||||
description="Please select a configuration option below.",
|
||||
color=await ctx.embed_color(),
|
||||
)
|
||||
|
||||
|
||||
class ConfigMenu(ui.View):
|
||||
def __init__(self, ctx: commands.Context, message: Message, type: str = None, timeout: int = None):
|
||||
super().__init__()
|
||||
self.ctx = ctx
|
||||
self.message = message
|
||||
self.type = type
|
||||
self.timeout = timeout
|
||||
|
||||
async def on_timeout(self):
|
||||
await self.message.edit(view=None)
|
Loading…
Add table
Add a link
Reference in a new issue