Little feedback improvements

This commit is contained in:
hodasemi 2022-05-05 07:44:36 +02:00
parent f2f8f8f394
commit 2f88f7b04f
2 changed files with 22 additions and 14 deletions

View file

@ -128,6 +128,15 @@ fn append_songs(
msg: &Message,
mut source: Vec<Song>,
) -> Result<()> {
msg.channel_id.say(
&ctx.http,
format!(
"adding {} {} to playlist",
source.len(),
if source.len() == 1 { "song" } else { "songs" }
),
)?;
media.playlist_mut().append(&mut source);
println!("start playing");

View file

@ -51,23 +51,22 @@ fn tag(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult {
let song_name = media_lock.song_name();
if media_lock
.db()
.execute(
match media_lock.db().execute(
&format!(
"INSERT INTO {} (name)
VALUES (?1)",
tag
),
params![song_name],
)
.is_err()
{
msg.channel_id.say(
) {
Ok(_) => msg
.channel_id
.say(&ctx.http, format!("add tag ({}) to {}", tag, song_name))?,
Err(_) => msg.channel_id.say(
&ctx.http,
format!("could not add tag ({}) for {}", tag, song_name),
)?;
}
)?,
};
Ok(())
}