Removed the about command

Removed leftover of the maintenance command
This commit is contained in:
2025-01-17 17:20:33 +01:00
parent 7c5d841399
commit da18c164c7
2 changed files with 1 additions and 38 deletions
-32
View File
@@ -1,32 +0,0 @@
import discord
from discord import app_commands
from discord.ext import commands
from cogs.base_cog import Base_Cog
import logging
from utils.portal import Portal
class About_Command(Base_Cog):
def __init__(self, bot:commands.Bot):
self.__bot = bot
super().__init__(logging.getLogger("cmds.about"))
@app_commands.command(name = "about", description = "Provides general information about the bot")
@app_commands.check(Maintenance_Command.handle_check)
async def about(self, ctx: discord.Interaction):
portal:Portal = Portal.instance()
embed = discord.Embed(title=f"POST IT - `{portal.PROGRAM_VERSION}`",
description="### Übersicht der Befehle\n- `/post` Veröffentlicht einen Post einer anderen Plattform, mit beliebigen Bildern als Anhang\n- `/help` Zeigt diese Übersicht an\n- `/settings` Persönliche Einstellungen für das verhalten des Bots\n- `/stats` Zeigt persönliche und globale Statistiken\n- `/debug` Erweiterte Informationen zum Betriebszustandes des Bots",
colour=0x5a5a5a)
embed.add_field(name="Status des Bots",
value="Fehlerfrei :green_circle:",
inline=True)
embed.add_field(name="Besitzer der Bot Instanz",
value=f"<@{portal.bot_config['DISCORD']['OWNER_ID']}>",
inline=True)
await ctx.response.send_message(embed = embed, ephemeral = True)
async def setup(bot:commands.Bot):
await bot.add_cog(About_Command(bot))
+1 -6
View File
@@ -32,7 +32,6 @@ from utils.portal import Portal
import asyncio import asyncio
from typing import Union from typing import Union
from platforms.reddit import Reddit_Adapter from platforms.reddit import Reddit_Adapter
from cogs.maintenance import Maintenance_Command
source_path = Path(__file__).resolve() source_path = Path(__file__).resolve()
base_path = source_path.parents[1] base_path = source_path.parents[1]
@@ -52,7 +51,7 @@ class MyBot(commands.Bot):
async def setup_hook(self): async def setup_hook(self):
# Register cogs to handle commands # Register cogs to handle commands
for cog_name in ["maintenance", "about", "debug", "reload", "post"]: for cog_name in ["about", "debug", "reload", "post"]:
await self.load_extension(f"cogs.{cog_name}") await self.load_extension(f"cogs.{cog_name}")
await self.tree.sync() await self.tree.sync()
@@ -79,8 +78,6 @@ class MyBot(commands.Bot):
async def on_connect(self): async def on_connect(self):
"""A coroutine to be called to setup the bot, after the bot is logged in but before it has connected to the Websocket""" """A coroutine to be called to setup the bot, after the bot is logged in but before it has connected to the Websocket"""
if not self.__first_on_ready: if not self.__first_on_ready:
instance: Maintenance_Command = self.get_cog("Maintenance_Command")
instance.enable_global_maintenance()
startup_logger.info(f"Beginning startup routine ...") startup_logger.info(f"Beginning startup routine ...")
routine_begin = datetime.now().timestamp() routine_begin = datetime.now().timestamp()
await self.change_presence(status = discord.Status.dnd, activity = discord.CustomActivity("Executing pre startup routine")) await self.change_presence(status = discord.Status.dnd, activity = discord.CustomActivity("Executing pre startup routine"))
@@ -100,8 +97,6 @@ class MyBot(commands.Bot):
await self.change_presence(status = discord.Status.online, activity = None) await self.change_presence(status = discord.Status.online, activity = None)
startup_logger.info(f"Startup routine finished after {get_elapsed_time_milliseconds(datetime.now().timestamp() - routine_begin)}") startup_logger.info(f"Startup routine finished after {get_elapsed_time_milliseconds(datetime.now().timestamp() - routine_begin)}")
instance.disable_gloabal_maintenance()
self.__first_on_ready = True self.__first_on_ready = True
else: else:
startup_logger.info("Startup routine allready executed, omitting this execution") startup_logger.info("Startup routine allready executed, omitting this execution")