Compare commits

..

No commits in common. "6614accb1de89457b00947b6e6e1123ed6b97ccf" and "9ac6d5ecb143f30c3c7b680355aefda59e4d12e0" have entirely different histories.

5 changed files with 7 additions and 27 deletions

View File

@ -26,7 +26,7 @@ class Admin(discord.Cog):
@__dev_group.command(name='update')
async def __update_bot(self, ctx: discord.ApplicationContext) -> None:
await ctx.defer()
await ctx.respond('starting update...')
if 0 == await self.bot.execute_shell('update.sh'):
await ctx.respond('Updated bot from https://github.com/Specoolazius/mcserver-discordbot\n'

View File

@ -3,7 +3,6 @@ Project is under GNU GENERAL PUBLIC LICENSE 3.0
2022, created by Specoolazius
"""
import os.path
import discord
from discord.commands import slash_command
@ -22,27 +21,9 @@ class StartStop(discord.Cog):
@slash_command(name='start')
async def __execute_start(self, ctx: discord.ApplicationContext) -> None:
await ctx.defer()
self.bot.is_server_starting = True
try:
returncode = await self.bot.execute_shell('start.sh')
self.bot.logger.info(f'Executed start.sh with exit code {returncode}')
except Exception as e:
self.bot.logger.error(
f'Failed to run start.sh\n'
f'Error: {e}'
)
await ctx.respond(
f'Failed to execute start.sh\n'
f'Check {os.path.join(self.bot.config.log_path, "discord.log")} for more detailed information'
)
else:
await ctx.respond('Server is starting')
returncode = None
@slash_command(name='stop')
async def __execute_stop(self, ctx: discord.ApplicationContext) -> None:
await ctx.defer()
await ctx.respond('Not implemented yet')
returncode = None
# hi

View File

@ -4,5 +4,5 @@
#
# 2022, created by Specoolazius
cd /root/mcserver-discordbot/bot || exit;
cd ~/mcserver-discordbot/bot || exit;
python3 -O run.py

View File

@ -8,4 +8,3 @@
git stash
git pull --rebase origin

View File

@ -6,7 +6,7 @@ Requires=network.target
[Service]
Type=idle
ExecStart=chmod +x /root/mcserver-discordbot/bot/run.sh && /root/mcserver-discordbot/bot/run.sh
ExecStart=/root/mcserver-discordbot/bot/run.sh
[Install]
WantedBy=default.target