Added Icons

This commit is contained in:
DerGrumpf 2024-10-09 20:23:24 +02:00
parent 1ef8a7937c
commit 3e616132d4
5 changed files with 27 additions and 8 deletions

BIN
bot/assets/clock.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
bot/assets/cloud.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
bot/assets/docker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
bot/assets/rip.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -24,6 +24,8 @@ class Server:
# Global List of all running Containers
containers = list()
color = discord.Color.from_rgb(13, 183, 237)
def seed_generator():
seed = random.randrange(1_000_000_000, 100_000_000_000_000)
if random.randrange(0,2) == 0:
@ -80,11 +82,12 @@ class Spawner(commands.Cog):
This could take up to **5 minutes**
''',
color=discord.Color.random(),
color=color,
timestamp=datetime.now(pytz.timezone('Europe/Berlin'))
)
start = await ctx.send(embed=embed)
file = discord.File("../assets/clock.png", filename="clock.png")
embed.set_thumbnail(url="attachment://clock.png")
start = await ctx.send(file=file, embed=embed)
port = find_free_port()
server_name = server_name.title()
@ -170,11 +173,13 @@ class Spawner(commands.Cog):
**Connection URL**:
garde-studios.de:{port}
''',
color=discord.Color.random(),
color=color,
timestamp=datetime.now(pytz.timezone('Europe/Berlin'))
)
file = discord.File("../assets/docker.png", filename="docker.png")
embed.set_thumbnail(url="attachment://docker.png")
await start.delete()
await ctx.send(embed=embed)
await ctx.send(file=file, embed=embed)
@commands.hybrid_command(name='servers')
async def servers(self, ctx: commands.Context):
@ -190,7 +195,7 @@ class Spawner(commands.Cog):
embed = discord.Embed(
title="Currently Running Servers",
description="List of all currently running Minecraft Servers",
color=discord.Color.random(),
color=color,
timestamp=datetime.now(pytz.timezone('Europe/Berlin'))
)
@ -200,7 +205,11 @@ class Spawner(commands.Cog):
*URL*: garde-studios.de:{container.port}
'''
embed.add_field(name=f'{container.name} 0/{container.players}', value=desc)
await ctx.send(embed=embed)
file = discord.File("../assets/cloud.png", filename="cloud.png")
embed.set_thumbnail(url="attachment://cloud.png")
await ctx.send(file=file, embed=embed)
@commands.hybrid_command(name='kill')
async def kill(self, ctx: commands.Context, server_name: str):
@ -234,7 +243,17 @@ class Spawner(commands.Cog):
#self.client.volumes.get(server_name).remove()
containers.remove(conn)
await ctx.send(f"Server {server_name} killed successfully")
embed = discord.Embed(
title="Killed",
description=f"{server_name} killed!",
color=color,
timestamp=datetime.now(pytz.timezone('Europe/Berlin'))
)
file = discord.File("../assets/rip.png", filename="rip.png")
embed.set_thumbnail(url="attachment://rip.png")
await ctx.send(file=file, embed=embed)
if __name__ == '__main__':
for _ in range(10):