diff options
| author | salmonik <salmonik@tuta.io> | 2026-10-27 18:14:07 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-10-27 18:14:07 +0100 |
| commit | fc5e0f48477366641b97efb0541053cc1e061be5 (patch) | |
| tree | 99ad0352552a0eebc527f3184a11ad2e7676ffea /src/lang.rs | |
| parent | silence songbird udp_rx decode noise (diff) | |
| download | senator-sperma-fc5e0f48477366641b97efb0541053cc1e061be5.tar.gz senator-sperma-fc5e0f48477366641b97efb0541053cc1e061be5.zip | |
music: add per-guild queue with now/next/last, skip and queue
Tracks are queued in memory per guild, defaulting to append (last).
Playback auto-advances on TrackEvent::End/Error with a per-track token
so manual stops and skips cannot double-advance. /music queue shows the
current track followed by pending items. /stop clears the queue.
Cron audio now goes through the same MusicState instead of poking the
track-handle map directly.
Diffstat (limited to '')
| -rw-r--r-- | src/lang.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lang.rs b/src/lang.rs index 4bba9b5..de6d23f 100644 --- a/src/lang.rs +++ b/src/lang.rs | |||
| @@ -91,8 +91,6 @@ pub fn fmt_math_result(r: &str) -> String { | |||
| 91 | pub const L_MUSIC_NEED_NAME: &str = "Daj mi nazwę pliku, URL albo plik"; | 91 | pub const L_MUSIC_NEED_NAME: &str = "Daj mi nazwę pliku, URL albo plik"; |
| 92 | pub const L_MUSIC_NO_AUDIO_ON_CP: &str = "Brak powiązanego audio na copyparty"; | 92 | pub const L_MUSIC_NO_AUDIO_ON_CP: &str = "Brak powiązanego audio na copyparty"; |
| 93 | pub const L_MUSIC_NO_URL_IN_RESULT: &str = "Wynik nie ma URL"; | 93 | pub const L_MUSIC_NO_URL_IN_RESULT: &str = "Wynik nie ma URL"; |
| 94 | pub const L_MUSIC_CANT_COMPRESS_LIVE: &str = | ||
| 95 | "Nie można skompresować transmisji na żywo, odtwarzam normalnie"; | ||
| 96 | pub const L_MUSIC_STOPPED: &str = "wyszed"; | 94 | pub const L_MUSIC_STOPPED: &str = "wyszed"; |
| 97 | pub const L_MUSIC_NO_AUDIO_ATTACHMENTS: &str = "Brak plików audio w wiadomości"; | 95 | pub const L_MUSIC_NO_AUDIO_ATTACHMENTS: &str = "Brak plików audio w wiadomości"; |
| 98 | pub const L_VOICE_USER_NOT_IN_VC: &str = "You are not in a voice channel"; | 96 | pub const L_VOICE_USER_NOT_IN_VC: &str = "You are not in a voice channel"; |
| @@ -122,6 +120,21 @@ pub fn fmt_music_search_failed(e: &dyn std::fmt::Display) -> String { | |||
| 122 | pub fn fmt_music_playing(name: &str) -> String { | 120 | pub fn fmt_music_playing(name: &str) -> String { |
| 123 | format!("Grajcowanie: `{name}`") | 121 | format!("Grajcowanie: `{name}`") |
| 124 | } | 122 | } |
| 123 | pub const L_MUSIC_QUEUE_EMPTY: &str = "Kolejka jest pusta"; | ||
| 124 | pub const L_MUSIC_QUEUE_HEADER: &str = "**Kolejka:**"; | ||
| 125 | pub const L_MUSIC_SKIPPED: &str = "Pominięto"; | ||
| 126 | pub fn fmt_music_queued(name: &str, position: usize) -> String { | ||
| 127 | format!("W kolejce (#{position}): `{name}`") | ||
| 128 | } | ||
| 129 | pub fn fmt_music_track_failed(name: &str, e: &dyn std::fmt::Display) -> String { | ||
| 130 | format!("Nie udało się odtworzyć `{name}`: `{e}`") | ||
| 131 | } | ||
| 132 | pub fn fmt_music_queue_current(name: &str, who: &str) -> String { | ||
| 133 | format!("▶ `{name}`{who}") | ||
| 134 | } | ||
| 135 | pub fn fmt_music_queue_item(index: usize, name: &str, who: &str) -> String { | ||
| 136 | format!("{index}. `{name}`{who}") | ||
| 137 | } | ||
| 125 | pub fn fmt_voice_joined(cid: &dyn std::fmt::Display) -> String { | 138 | pub fn fmt_voice_joined(cid: &dyn std::fmt::Display) -> String { |
| 126 | format!("Dołączon <#{cid}>") | 139 | format!("Dołączon <#{cid}>") |
| 127 | } | 140 | } |
