mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 23:37:47 +00:00
slash command descriptions configurable by config
This commit is contained in:
+8
-7
@@ -1,18 +1,16 @@
|
||||
from context import CustomContext
|
||||
from discord.ext import commands
|
||||
from utils.EmbedGenerator import EmbedGenerator
|
||||
from utils.classes import BaseCog
|
||||
from utils.database import AutoJoin
|
||||
from bot import ChristmasBot
|
||||
from discord.ext.commands import Context
|
||||
|
||||
|
||||
class SettingsCog(commands.Cog, name="Settings"):
|
||||
def __init__(self, bot: ChristmasBot):
|
||||
self.bot = bot
|
||||
|
||||
class SettingsCog(BaseCog, name="Settings"):
|
||||
@commands.group(aliases=["aj"], invoke_without_command=True)
|
||||
@commands.cooldown(rate=1, per=5, type=commands.BucketType.user)
|
||||
async def autojoin(self, ctx: CustomContext):
|
||||
"""Enable/Disable the bot automatically joining"""
|
||||
await EmbedGenerator.Message(
|
||||
ctx,
|
||||
"Autojoin",
|
||||
@@ -23,16 +21,19 @@ class SettingsCog(commands.Cog, name="Settings"):
|
||||
@commands.has_permissions(manage_channels=True)
|
||||
@commands.cooldown(rate=1, per=5, type=commands.BucketType.user)
|
||||
async def autojoin_set(self, ctx: CustomContext):
|
||||
"""Enable the bot automatically joining"""
|
||||
voicechannel_id = ctx.author.voice.channel.id
|
||||
textchannel_id = ctx.message.channel.id
|
||||
await AutoJoin.update_channel(ctx.get_redis(), ctx.guild.id, voicechannel_id, textchannel_id)
|
||||
await AutoJoin.update_channel(
|
||||
ctx.get_redis(), ctx.guild.id, voicechannel_id, textchannel_id
|
||||
)
|
||||
await EmbedGenerator.Message(ctx, "Autojoin", "`enabled`")
|
||||
|
||||
@autojoin.command(name="disable")
|
||||
@commands.has_permissions(manage_channels=True)
|
||||
@commands.cooldown(rate=1, per=5, type=commands.BucketType.user)
|
||||
async def autojoin_del(self, ctx: CustomContext):
|
||||
vc = ctx.author.voice.channel
|
||||
"""Disable the bot automatically joining"""
|
||||
await AutoJoin.del_channel(ctx.get_redis(), ctx.guild.id)
|
||||
await EmbedGenerator.Message(ctx, "Autojoin", "`disabled`")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user