mirror of
https://github.com/migatu/conjurer.git
synced 2026-07-14 13:34:40 +00:00
Audition
This commit is contained in:
@@ -143,6 +143,8 @@ GET_MP3 = "/mp3"
|
||||
SEND_MP3 = "/update_mp3"
|
||||
GET_PLAYLIST = "/get_music"
|
||||
ADD_TO_PRIO_PLAYLIST = "/add_to_priority"
|
||||
CREATE_PRIO_PLAYLIST = "/create_priority_playlist"
|
||||
|
||||
REQUEST_MUSIC = "/request_radio_file"
|
||||
CLEAR_PRIO = "/clear_pr_pls"
|
||||
LIBRARIAN_SERVICE_ADDRESS = "http://192.168.1.192:5001"
|
||||
@@ -1868,6 +1870,41 @@ async def request_radio(ctx):
|
||||
timeout=360,
|
||||
)
|
||||
_ = await coroutine
|
||||
|
||||
@client.hybrid_command(
|
||||
name="stworz_audycje",
|
||||
description="Dodaje do listy ulubionych w radiu",
|
||||
guild=discord.Object(id=664789470779932693),
|
||||
)
|
||||
async def stworz_audycje(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()
|
||||
jrequest = {
|
||||
"lista_slow": word_list,
|
||||
"dlugosc_plejlisty": dlugosc_playlisty,
|
||||
"UUID": str(uuid.uuid4()),
|
||||
}
|
||||
coroutine = asyncio.to_thread(
|
||||
requests.post,
|
||||
f"{FILE_SERVICE_ADDRESS}{CREATE_PRIO_PLAYLIST}",
|
||||
json=jrequest,
|
||||
timeout=360,
|
||||
)
|
||||
_ = await coroutine
|
||||
|
||||
|
||||
@client.hybrid_command(
|
||||
name="wyczysc_ulubione",
|
||||
description="Czysci liste ulubionych w radiu",
|
||||
|
||||
Reference in New Issue
Block a user