insert a user when necessary
This commit is contained in:
parent
64366ce071
commit
efe9e34669
10
src/main.rs
10
src/main.rs
@ -974,6 +974,16 @@ async fn set_greet_sound(ctx: &Context, msg: &Message, args: Args) -> CommandRes
|
|||||||
let query = args.rest();
|
let query = args.rest();
|
||||||
let user_id = *msg.author.id.as_u64();
|
let user_id = *msg.author.id.as_u64();
|
||||||
|
|
||||||
|
let _ = sqlx::query!(
|
||||||
|
"
|
||||||
|
INSERT IGNORE INTO users (user)
|
||||||
|
VALUES (?)
|
||||||
|
",
|
||||||
|
user_id
|
||||||
|
)
|
||||||
|
.execute(&pool)
|
||||||
|
.await;
|
||||||
|
|
||||||
if query.len() == 0 {
|
if query.len() == 0 {
|
||||||
sqlx::query!(
|
sqlx::query!(
|
||||||
"
|
"
|
||||||
|
Loading…
Reference in New Issue
Block a user