Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
9cfcb0d09c | |||
cc55b3e1d1 | |||
a9a08e656f |
@ -2,7 +2,7 @@
|
|||||||
name = "soundfx-rs"
|
name = "soundfx-rs"
|
||||||
description = "Discord bot for custom sound effects and soundboards"
|
description = "Discord bot for custom sound effects and soundboards"
|
||||||
license = "AGPL-3.0-only"
|
license = "AGPL-3.0-only"
|
||||||
version = "1.5.7"
|
version = "1.5.8"
|
||||||
authors = ["jellywx <judesouthworth@pm.me>"]
|
authors = ["jellywx <judesouthworth@pm.me>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
2
debian/.gitignore
vendored
2
debian/.gitignore
vendored
@ -1,2 +0,0 @@
|
|||||||
*
|
|
||||||
!.gitignore
|
|
13
debian/postinst
vendored
Executable file
13
debian/postinst
vendored
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id -u soundfx &>/dev/null || useradd -r -M soundfx
|
||||||
|
|
||||||
|
if [ ! -f /etc/soundfx-rs/config.env ]; then
|
||||||
|
cp /etc/soundfx-rs/default.env /etc/soundfx-rs/config.env
|
||||||
|
fi
|
||||||
|
|
||||||
|
chown soundfx /etc/soundfx-rs/config.env
|
||||||
|
|
||||||
|
#DEBHELPER#
|
11
debian/postrm
vendored
Normal file
11
debian/postrm
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id -u soundfx &>/dev/null || userdel soundfx
|
||||||
|
|
||||||
|
if [ -f /etc/soundfx-rs/config.env ]; then
|
||||||
|
rm /etc/soundfx/config.env
|
||||||
|
fi
|
||||||
|
|
||||||
|
#DEBHELPER#
|
@ -68,8 +68,8 @@ pub async fn register_application_commands(
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
if Path::new("/etc/soundfx-rs/default.env").exists() {
|
if Path::new("/etc/soundfx-rs/config.env").exists() {
|
||||||
dotenv::from_path("/etc/soundfx-rs/default.env").unwrap();
|
dotenv::from_path("/etc/soundfx-rs/config.env").unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
@ -409,16 +409,9 @@ WHERE
|
|||||||
&self,
|
&self,
|
||||||
db_pool: impl Executor<'_, Database = Database>,
|
db_pool: impl Executor<'_, Database = Database>,
|
||||||
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||||
sqlx::query!(
|
sqlx::query!("DELETE FROM sounds WHERE id = ?", self.id)
|
||||||
"
|
.execute(db_pool)
|
||||||
DELETE
|
.await?;
|
||||||
FROM sounds
|
|
||||||
WHERE id = ?
|
|
||||||
",
|
|
||||||
self.id
|
|
||||||
)
|
|
||||||
.execute(db_pool)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
Description=Discord bot for custom sound effects and soundboards
|
Description=Discord bot for custom sound effects and soundboards
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
User=soundfx
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/soundfx-rs
|
ExecStart=/usr/bin/soundfx-rs
|
||||||
WorkingDirectory=/etc/soundfx-rs
|
WorkingDirectory=/etc/soundfx-rs
|
||||||
|
Reference in New Issue
Block a user