2 Commits

Author SHA1 Message Date
80f45a1f5c Add script to dump sounds to files. 2023-06-23 15:27:38 +01:00
1a1b1b8144 Fix typo 2023-05-07 20:53:16 +01:00
3 changed files with 9 additions and 21 deletions

2
debian/postrm vendored
View File

@ -5,7 +5,7 @@ set -e
id -u soundfx &>/dev/null || userdel soundfx
if [ -f /etc/soundfx-rs/config.env ]; then
rm /etc/soundfx/config.env
rm /etc/soundfx-rs/config.env
fi
#DEBHELPER#

8
dump-query.sh Executable file
View File

@ -0,0 +1,8 @@
mysql -D soundfx -N -e "SELECT name, hex(src) FROM sounds" > out
split --additional-suffix=.row -l 1 out
for filename in *.row; do
name=`grep -oP '^(.+)(?=\t)' $filename`
col=`awk -F '\t' '{print $2}' "$filename"`
echo $col > "$filename.hex"
xxd -r -p "$filename.hex" "$name.opus"
done

View File

@ -316,21 +316,6 @@ pub async fn soundboard(
#[description = "Name or ID of sound for button 20"]
#[autocomplete = "autocomplete_sound"]
sound_20: Option<String>,
#[description = "Name or ID of sound for button 21"]
#[autocomplete = "autocomplete_sound"]
sound_21: Option<String>,
#[description = "Name or ID of sound for button 22"]
#[autocomplete = "autocomplete_sound"]
sound_22: Option<String>,
#[description = "Name or ID of sound for button 23"]
#[autocomplete = "autocomplete_sound"]
sound_23: Option<String>,
#[description = "Name or ID of sound for button 24"]
#[autocomplete = "autocomplete_sound"]
sound_24: Option<String>,
#[description = "Name or ID of sound for button 25"]
#[autocomplete = "autocomplete_sound"]
sound_25: Option<String>,
) -> Result<(), Error> {
ctx.defer().await?;
@ -355,11 +340,6 @@ pub async fn soundboard(
sound_18,
sound_19,
sound_20,
sound_21,
sound_22,
sound_23,
sound_24,
sound_25,
];
let mut sounds = vec![];