slash command descriptions configurable by config

This commit is contained in:
2021-11-05 23:01:27 +01:00
parent 3c9772b8f1
commit a1238b52ae
6 changed files with 44 additions and 39 deletions
+10 -17
View File
@@ -10,15 +10,13 @@ import datetime
import lavalink
from bot import ChristmasBot
from utils.EmbedGenerator import EmbedGenerator
from utils.classes import BaseCog
from utils.paginator import HelpPaginator
class InformationCog(commands.Cog, name="Information"):
def __init__(self, bot: ChristmasBot):
self.bot = bot
class InformationCog(BaseCog, name="Information"):
@commands.command(name="ping", aliases=["pong"])
@commands.cooldown(rate=1, per=5, type=commands.BucketType.user)
@commands.command(description="PONG!", aliases=["pong"])
async def ping(self, ctx: Context):
"""Test the latency"""
avatar = ctx.author.avatar.with_static_format("jpeg")
@@ -39,24 +37,18 @@ class InformationCog(commands.Cog, name="Information"):
embed.set_footer(text=f"Requested by: {ctx.author}", icon_url=f"{avatar}")
await msg.edit(embed=embed)
@commands.command(
name="invite", description="Gets the invite link!", slash_commands=True
)
@commands.command(name="invite")
@commands.cooldown(rate=1, per=5, type=commands.BucketType.user)
async def invite(self, ctx: Context):
"""Gets the invite link!"""
"""Gets the invite link"""
await EmbedGenerator.Message(
ctx, "Add our bot to your server:", self.bot.invite_link
)
@commands.command(
name="wlinfo",
description="Retrieve various Node/Server/Player information.",
slash_commands=True,
)
@commands.command(name="wlinfo")
@commands.cooldown(rate=1, per=5, type=commands.BucketType.user)
async def wlinfo(self, ctx: Context):
"""Retrieve various Node/Server/Player information."""
"""Retrieve various node/server/player information"""
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
node = player.node
@@ -79,9 +71,10 @@ class InformationCog(commands.Cog, name="Information"):
await ctx.send(fmt)
from utils import database
database.AutoJoin.get_channels()
@commands.command(name="help", aliases=["about", "info"], slash_command=True)
@commands.command(name="help", aliases=["about", "info"])
@commands.cooldown(1, 1, commands.BucketType.user)
async def about(
self,
@@ -90,7 +83,7 @@ class InformationCog(commands.Cog, name="Information"):
description="Show help for a command or category"
),
):
"""ChristmasBot command list"""
"""Retrieve a list of possible commands"""
if command:
entity = self.bot.get_cog(command) or self.bot.get_command(command)