slash command descriptions configurable by config

This commit is contained in:
niku committed 2021-11-05 23:01:27 +01:00
1 parent 3c9772b8f1
commit a1238b52ae
6 files changed
+44 -39

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
from typing import Dict
from discord.ext.commands import Cog
from bot import ChristmasBot
class BaseCog(Cog):
def __init__(self, bot: ChristmasBot) -> None:
self.bot = bot
slash_descriptions: Dict[str, str] = self.bot.config["slash_descriptions"]
for command in self.walk_commands():
if brief := slash_descriptions.get(command.qualified_name):
command.brief = brief