From b77f4789ab8dc1a209b311ea47b1f0901db91dbf Mon Sep 17 00:00:00 2001 From: Specoolazius Date: Thu, 31 Mar 2022 15:15:15 +0200 Subject: [PATCH] removed unused files --- bot/extensions/developer.py | 15 ------------- bot/extensions/executer.py | 37 ------------------------------- bot/extensions/presence.py | 10 --------- bot/libs/__init__.py | 1 - bot/libs/bot.py | 44 ------------------------------------- bot/scripts/start-server.sh | 3 --- 6 files changed, 110 deletions(-) delete mode 100644 bot/extensions/developer.py delete mode 100644 bot/extensions/executer.py delete mode 100644 bot/extensions/presence.py delete mode 100644 bot/libs/__init__.py delete mode 100644 bot/libs/bot.py delete mode 100644 bot/scripts/start-server.sh diff --git a/bot/extensions/developer.py b/bot/extensions/developer.py deleted file mode 100644 index d1b5b2a..0000000 --- a/bot/extensions/developer.py +++ /dev/null @@ -1,15 +0,0 @@ -import discord - -from libs import ServerBot - - -class Developer(discord.Cog): - - def __init__(self, bot: ServerBot): - self.bot = bot - - - - -def setup(bot: ServerBot): - bot.add_cog(Developer(bot)) \ No newline at end of file diff --git a/bot/extensions/executer.py b/bot/extensions/executer.py deleted file mode 100644 index 7293409..0000000 --- a/bot/extensions/executer.py +++ /dev/null @@ -1,37 +0,0 @@ -import asyncio -import os.path - -import discord -from discord.commands import slash_command - -from libs import ServerBot - - -class Executer(discord.Cog): - - def __init__(self, bot: ServerBot): - self.bot = bot - - @slash_command(name='start') - async def __start_server(self, ctx: discord.ApplicationContext) -> None: - await ctx.defer() - - await asyncio.create_subprocess_exec( - os.path.join('scripts', 'start-server.sh'), - stdout=asyncio.subprocess.PIPE, - stderr=asyncio.subprocess.PIPE, - ) - - await ctx.respond('starting server') - - @slash_command(name='stop') - async def __stop_server(self, ctx: discord.ApplicationContext) -> None: - if ctx.user.id not in self.bot.admin_ids: - await ctx.respond('You don\'t have permissions to do that', ephemeral=True) - return - - await ctx.respond('Stopping server') - - -def setup(bot: ServerBot): - bot.add_cog(Executer(bot)) diff --git a/bot/extensions/presence.py b/bot/extensions/presence.py deleted file mode 100644 index d40f70c..0000000 --- a/bot/extensions/presence.py +++ /dev/null @@ -1,10 +0,0 @@ -import discord -from mcstatus import JavaServer - -from libs import ServerBot - - -class Presence(discord.Cog): - """ - - """ diff --git a/bot/libs/__init__.py b/bot/libs/__init__.py deleted file mode 100644 index 567f68b..0000000 --- a/bot/libs/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .bot import ServerBot diff --git a/bot/libs/bot.py b/bot/libs/bot.py deleted file mode 100644 index 8ccf295..0000000 --- a/bot/libs/bot.py +++ /dev/null @@ -1,44 +0,0 @@ -import os.path -from abc import ABC -from typing import Any - -from mcstatus import JavaServer - -import discord -from discord.commands import slash_command - -TOKEN = "" - - -class ServerBot(discord.Bot, ABC): - - def __init__(self): - super(ServerBot, self).__init__( - # general config - owner_id=448814943857410058, - - # starting presence - activity=discord.Game('Beep Boop! Loading...'), - # activity=discord.Game('with 10 people on sfs.ddnss.org'), - status=discord.Status.idle, - - # debug - debug_guilds=[848137923101982741, 958692739065720832], - ) - - # loading extensions - from extensions.executer import Executer - self.add_cog(Executer(self)) - from extensions.developer import Developer - self.add_cog(Developer(self)) - - self.admin_ids = [448814943857410058] - - def run(self, *args: Any, **kwargs: Any) -> None: - super(ServerBot, self).run(TOKEN, *args, **kwargs) - - async def on_ready(self) -> None: - print('online') - - - diff --git a/bot/scripts/start-server.sh b/bot/scripts/start-server.sh deleted file mode 100644 index 3a9bdb3..0000000 --- a/bot/scripts/start-server.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -wakeonlan 90:1B:0E:A5:45:82