Tag: 1.10

Intermediate commits (oldest → newest):
- fix of permissions
- path fix
- another approach
- test
- test2
- Test
- Fix
- Skip track
- fix
This commit is contained in:
2025-10-30 16:59:05 +01:00
parent 6f3eee90bb
commit b2af595122
3 changed files with 31 additions and 7 deletions
+14 -4
View File
@@ -136,6 +136,9 @@ MUZYKA_MOJEGO_LUDU_SLOWA_KLUCZOWE = 15
MUZYKA_MOJEGO_LUDU_PLAJLISTA = 30
FILE_SERVICE_ADDRESS = "http://192.168.1.15:5000"
RADIO_HARBOR_ADDRESS = "http://192.168.1.15:54321"
SKIP_TRACK = "/skip"
GET_MP3 = "/mp3"
SEND_MP3 = "/update_mp3"
GET_PLAYLIST = "/get_music"
@@ -1355,10 +1358,17 @@ async def skip_track(ctx):
async with ctx.typing():
allowed = False
for role in ctx.author.roles:
if role.name == "Thane":
if role.name in ("Thane","Jarl"):
allowed = True
if not allowed:
await ctx.send("Łapy precz od radia")
else:
coroutine = asyncio.to_thread(
requests.get,
f"{RADIO_HARBOR_ADDRESS}{SKIP_TRACK}",
timeout=360,
)
_ = await coroutine
@client.hybrid_command(
@@ -1370,13 +1380,13 @@ async def zrestartuj_radio(ctx):
async with ctx.typing():
allowed = False
for role in ctx.author.roles:
if role.name == "Thane":
if role.name in ("Thane","Jarl"):
allowed = True
if not allowed:
await ctx.send("Łapy precz od radia")
else:
subprocess.call(['sh', './restart_radio.sh'])
retcode = subprocess.run("/home/pi/Conjurer/restart_radio.sh", shell=False, check = False, capture_output = True)
logger.info("Wynik: %s",retcode)
@client.hybrid_command(
name="dej_co_ze_spotifaja",