mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 21:38:38 +00:00
Radiostation control
This commit is contained in:
@@ -191,6 +191,8 @@ FILE_SERVICE_ADDRESS = "http://192.168.1.15:5000"
|
|||||||
GET_MP3 = "/mp3"
|
GET_MP3 = "/mp3"
|
||||||
SEND_MP3 = "/update_mp3"
|
SEND_MP3 = "/update_mp3"
|
||||||
GET_PLAYLIST = "/get_music"
|
GET_PLAYLIST = "/get_music"
|
||||||
|
ADD_TO_PRIO_PLAYLIST = "/add_to_priority"
|
||||||
|
CLEAR_PRIO = "/clear_pr_pls"
|
||||||
LIBRARIAN_SERVICE_ADDRESS = "http://192.168.1.192:5001"
|
LIBRARIAN_SERVICE_ADDRESS = "http://192.168.1.192:5001"
|
||||||
SEND_QUERY = "/query"
|
SEND_QUERY = "/query"
|
||||||
TIME_BETWEEN_CALLS = 100000
|
TIME_BETWEEN_CALLS = 100000
|
||||||
@@ -1353,6 +1355,7 @@ async def wyszukaj(ctx, how_many=0, slowa_kluczowe=None):
|
|||||||
json=jrequest,
|
json=jrequest,
|
||||||
timeout=360,
|
timeout=360,
|
||||||
)
|
)
|
||||||
|
|
||||||
return_data = await coroutine
|
return_data = await coroutine
|
||||||
if not return_data.status_code == 200:
|
if not return_data.status_code == 200:
|
||||||
await ctx.send("Wołaj szefa - coś się wyjebało")
|
await ctx.send("Wołaj szefa - coś się wyjebało")
|
||||||
@@ -1778,6 +1781,63 @@ async def zagraj_mi_kawalek(ctx):
|
|||||||
"Obawiam się że nie mogę nic znaleźć u siebie. Spróbuj komendy '$dej_co_ze_spotifaja' jeśli masz link"
|
"Obawiam się że nie mogę nic znaleźć u siebie. Spróbuj komendy '$dej_co_ze_spotifaja' jeśli masz link"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@client.hybrid_command(
|
||||||
|
name="dodaj_do_ulubionych",
|
||||||
|
description="Dodaje do listy ulubionych w radiu",
|
||||||
|
guild=discord.Object(id=664789470779932693),
|
||||||
|
)
|
||||||
|
async def dodaj_do_ulubionych(ctx):
|
||||||
|
"""
|
||||||
|
Generate a playlist in queue. First word in this command shall be int defining length of the playlist.
|
||||||
|
Rest of the line are search terms.
|
||||||
|
|
||||||
|
:param ctx: ctx stands for "context" and is a parameter commonly used in Discord.py commands. It
|
||||||
|
represents the context in which the command was invoked, including information such as the message,
|
||||||
|
the channel, the server, and the user who invoked the command. This parameter is required in all
|
||||||
|
Discord.py commands
|
||||||
|
"""
|
||||||
|
async with ctx.typing():
|
||||||
|
logger.info("Zaczynam szukać timestamp %s", datetime.now())
|
||||||
|
|
||||||
|
dlugosc_playlisty = ctx.message.content.split()[1]
|
||||||
|
word_list = ctx.message.content.split[1:]
|
||||||
|
jrequest = {
|
||||||
|
"lista_slow": word_list,
|
||||||
|
"dlugosc_plejlisty": dlugosc_playlisty,
|
||||||
|
"UUID": str(uuid.uuid4()),
|
||||||
|
}
|
||||||
|
coroutine = asyncio.to_thread(
|
||||||
|
requests.post,
|
||||||
|
f"{FILE_SERVICE_ADDRESS}{ADD_TO_PRIO_PLAYLIST}",
|
||||||
|
json=jrequest,
|
||||||
|
timeout=360,
|
||||||
|
)
|
||||||
|
_ = await coroutine
|
||||||
|
|
||||||
|
@client.hybrid_command(
|
||||||
|
name="wyczysc_ulubione",
|
||||||
|
description="Czysci liste ulubionych w radiu",
|
||||||
|
guild=discord.Object(id=664789470779932693),
|
||||||
|
)
|
||||||
|
async def wyczysc_ulubione(ctx):
|
||||||
|
"""
|
||||||
|
Generate a playlist in queue. First word in this command shall be int defining length of the playlist.
|
||||||
|
Rest of the line are search terms.
|
||||||
|
|
||||||
|
:param ctx: ctx stands for "context" and is a parameter commonly used in Discord.py commands. It
|
||||||
|
represents the context in which the command was invoked, including information such as the message,
|
||||||
|
the channel, the server, and the user who invoked the command. This parameter is required in all
|
||||||
|
Discord.py commands
|
||||||
|
"""
|
||||||
|
async with ctx.typing():
|
||||||
|
coroutine = asyncio.to_thread(
|
||||||
|
requests.post,
|
||||||
|
f"{FILE_SERVICE_ADDRESS}{CLEAR_PRIO}",
|
||||||
|
json={},
|
||||||
|
timeout=360,
|
||||||
|
)
|
||||||
|
_ = await coroutine
|
||||||
|
|
||||||
|
|
||||||
@client.hybrid_command(
|
@client.hybrid_command(
|
||||||
name="zrob_mi_plejliste",
|
name="zrob_mi_plejliste",
|
||||||
|
|||||||
Reference in New Issue
Block a user