Radio restart serverside

This commit is contained in:
2024-06-19 17:46:38 +02:00
parent 8a99ee7c99
commit 0f49cb89a3
4 changed files with 61 additions and 11 deletions
+32
View File
@@ -19,6 +19,7 @@ import shutil
import sys
import threading
import uuid
import subprocessS
from datetime import datetime
from logging import handlers
from pathlib import Path, PurePath
@@ -1345,6 +1346,37 @@ async def max_weight(lista):
# *=========================================== Define Commands
@client.hybrid_command(
name="skip_track",
description="Przeskocz kawałek w radiu",
guild=discord.Object(id=664789470779932693),
)
async def skip_track(ctx):
with ctx.typing():
allowed = False
for role in ctx.author.roles:
if role.name == "Thane":
allowed = True
if not allowed:
await ctx.send("Łapy precz od radia")
@client.hybrid_command(
name="zrestartuj_radio",
description="Komenda ktora uruchamia radio ponownie jakby się zawiesiło",
guild=discord.Object(id=664789470779932693),
)
async def zrestartuj_radio(ctx):
with ctx.typing():
allowed = False
for role in ctx.author.roles:
if role.name == "Thane":
allowed = True
if not allowed:
await ctx.send("Łapy precz od radia")
else:
subprocess.call(['sh', './restart_radio.sh'])
@client.hybrid_command(
name="dej_co_ze_spotifaja",