Merge pull request #1 from strNophix/config-mods

Config file mods + invite link
This commit is contained in:
2021-10-31 13:39:12 +01:00
committed by GitHub
3 changed files with 14 additions and 14 deletions
+6 -2
View File
@@ -25,14 +25,18 @@ class ChristmasBot(commands.Bot):
self.invite_link: str = "" self.invite_link: str = ""
slash_guilds = None
if len(self.config["slash_command_guilds"]) > 0:
slash_guilds = self.config["slash_command_guilds"]
super().__init__( super().__init__(
command_prefix=self.prefix_callable, command_prefix=self.prefix_callable,
description=self.config["info"].get("description", ""), description=self.config["info"]["description"],
case_insensitive=False, case_insensitive=False,
fetch_offline_members=False, fetch_offline_members=False,
intents=intents, intents=intents,
slash_commands=True, slash_commands=True,
slash_command_guilds=[227431704426446848], slash_command_guilds=slash_guilds,
) )
self.loop.create_task(self.async_init()) self.loop.create_task(self.async_init())
+6 -4
View File
@@ -6,12 +6,13 @@ from discord.ext.commands import Context
import humanize import humanize
import datetime import datetime
import lavalink import lavalink
from bot import ChristmasBot
from utils.EmbedGenerator import EmbedGenerator from utils.EmbedGenerator import EmbedGenerator
from utils.paginator import HelpPaginator from utils.paginator import HelpPaginator
class InformationCog(commands.Cog, name="Information"): class InformationCog(commands.Cog, name="Information"):
def __init__(self, bot: commands.Bot): def __init__(self, bot: ChristmasBot):
self.bot = bot self.bot = bot
self.is_help_msg = True self.is_help_msg = True
self.update_status.start() self.update_status.start()
@@ -53,8 +54,9 @@ class InformationCog(commands.Cog, name="Information"):
@commands.cooldown(rate=1, per=5, type=commands.BucketType.user) @commands.cooldown(rate=1, per=5, type=commands.BucketType.user)
async def invite(self, ctx: Context): async def invite(self, ctx: Context):
"""Gets the invite link!""" """Gets the invite link!"""
link = f"https://discord.com/oauth2/authorize?client_id=643555373814382593&permissions=3230720&scope=bot%20applications.commands" embed = await EmbedGenerator.Message(
embed = await EmbedGenerator.Message(ctx, "Add our bot to your server:", link) ctx, "Add Christmas Music to your server:", self.bot.invite_link
)
await ctx.send(embed=embed) await ctx.send(embed=embed)
@commands.command( @commands.command(
@@ -129,6 +131,6 @@ class InformationCog(commands.Cog, name="Information"):
await ctx.send(embed=embed) await ctx.send(embed=embed)
def setup(bot: commands.Bot): def setup(bot: ChristmasBot):
bot.remove_command("help") bot.remove_command("help")
bot.add_cog(InformationCog(bot)) bot.add_cog(InformationCog(bot))
+2 -8
View File
@@ -2,13 +2,6 @@
"token": "", "token": "",
"owner_ids": [194545408960102400, 190875175460405249], "owner_ids": [194545408960102400, 190875175460405249],
"prefixes": ["ck!"], "prefixes": ["ck!"],
"database": {
"host": "",
"port": 3306,
"user": "",
"password": "",
"db": ""
},
"lavalink": { "lavalink": {
"host": "", "host": "",
"port": 2333, "port": 2333,
@@ -23,5 +16,6 @@
"name": "CloudKid Radio", "name": "CloudKid Radio",
"description": "A sample bot description" "description": "A sample bot description"
}, },
"cogs": ["cogs.owner", "cogs.settings", "cogs.information", "cogs.music"] "cogs": ["cogs.owner", "cogs.settings", "cogs.information", "cogs.music"],
"slash_command_guilds": []
} }