Remove broken is_text_based check
This commit is contained in:
parent
8390bf0ec6
commit
6d324e10cb
@ -25,10 +25,6 @@ pub async fn play(
|
|||||||
|
|
||||||
let guild = ctx.guild().unwrap();
|
let guild = ctx.guild().unwrap();
|
||||||
|
|
||||||
if channel.as_ref().map_or(false, |c| c.is_text_based()) {
|
|
||||||
ctx.say("The channel specified is not a voice channel.")
|
|
||||||
.await?;
|
|
||||||
} else {
|
|
||||||
ctx.say(
|
ctx.say(
|
||||||
play_from_query(
|
play_from_query(
|
||||||
&ctx.serenity_context(),
|
&ctx.serenity_context(),
|
||||||
@ -42,7 +38,6 @@ pub async fn play(
|
|||||||
.await,
|
.await,
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
public = 1 OR
|
public = 1 OR
|
||||||
uploader_id = ? OR
|
uploader_id = ? OR
|
||||||
server_id = ?
|
server_id = ?
|
||||||
)
|
)",
|
||||||
",
|
|
||||||
id,
|
id,
|
||||||
user_id,
|
user_id,
|
||||||
guild_id
|
guild_id
|
||||||
@ -139,8 +138,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
) DESC,
|
) DESC,
|
||||||
server_id = ? DESC,
|
server_id = ? DESC,
|
||||||
public = 1 DESC,
|
public = 1 DESC,
|
||||||
rand()
|
rand()",
|
||||||
",
|
|
||||||
name,
|
name,
|
||||||
user_id,
|
user_id,
|
||||||
guild_id,
|
guild_id,
|
||||||
@ -170,8 +168,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
) DESC,
|
) DESC,
|
||||||
server_id = ? DESC,
|
server_id = ? DESC,
|
||||||
public = 1 DESC,
|
public = 1 DESC,
|
||||||
rand()
|
rand()",
|
||||||
",
|
|
||||||
name,
|
name,
|
||||||
user_id,
|
user_id,
|
||||||
guild_id,
|
guild_id,
|
||||||
@ -206,8 +203,7 @@ WHERE name LIKE CONCAT(?, '%') AND (uploader_id = ? OR server_id = ? OR EXISTS(
|
|||||||
FROM favorite_sounds
|
FROM favorite_sounds
|
||||||
WHERE sound_id = id AND user_id = ?
|
WHERE sound_id = id AND user_id = ?
|
||||||
))
|
))
|
||||||
LIMIT 25
|
LIMIT 25",
|
||||||
",
|
|
||||||
query,
|
query,
|
||||||
user_id,
|
user_id,
|
||||||
guild_id.into(),
|
guild_id.into(),
|
||||||
@ -234,8 +230,7 @@ WHERE name LIKE CONCAT(?, '%') AND EXISTS(
|
|||||||
FROM favorite_sounds
|
FROM favorite_sounds
|
||||||
WHERE sound_id = id AND user_id = ?
|
WHERE sound_id = id AND user_id = ?
|
||||||
)
|
)
|
||||||
LIMIT 25
|
LIMIT 25",
|
||||||
",
|
|
||||||
query,
|
query,
|
||||||
user_id.into(),
|
user_id.into(),
|
||||||
)
|
)
|
||||||
@ -257,8 +252,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
FROM sounds
|
FROM sounds
|
||||||
WHERE uploader_id = ?
|
WHERE uploader_id = ?
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
LIMIT ?, ?
|
LIMIT ?, ?",
|
||||||
",
|
|
||||||
user_id.into(),
|
user_id.into(),
|
||||||
page * 25,
|
page * 25,
|
||||||
(page + 1) * 25
|
(page + 1) * 25
|
||||||
@ -273,8 +267,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
SELECT name, id, public, server_id, uploader_id
|
SELECT name, id, public, server_id, uploader_id
|
||||||
FROM sounds
|
FROM sounds
|
||||||
WHERE uploader_id = ?
|
WHERE uploader_id = ?
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC",
|
||||||
",
|
|
||||||
user_id.into()
|
user_id.into()
|
||||||
)
|
)
|
||||||
.fetch_all(&self.database)
|
.fetch_all(&self.database)
|
||||||
@ -300,8 +293,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
INNER JOIN favorite_sounds f ON sounds.id = f.sound_id
|
INNER JOIN favorite_sounds f ON sounds.id = f.sound_id
|
||||||
WHERE f.user_id = ?
|
WHERE f.user_id = ?
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
LIMIT ?, ?
|
LIMIT ?, ?",
|
||||||
",
|
|
||||||
user_id.into(),
|
user_id.into(),
|
||||||
page * 25,
|
page * 25,
|
||||||
(page + 1) * 25
|
(page + 1) * 25
|
||||||
@ -317,8 +309,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
FROM sounds
|
FROM sounds
|
||||||
INNER JOIN favorite_sounds f ON sounds.id = f.sound_id
|
INNER JOIN favorite_sounds f ON sounds.id = f.sound_id
|
||||||
WHERE f.user_id = ?
|
WHERE f.user_id = ?
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC",
|
||||||
",
|
|
||||||
user_id.into()
|
user_id.into()
|
||||||
)
|
)
|
||||||
.fetch_all(&self.database)
|
.fetch_all(&self.database)
|
||||||
@ -343,8 +334,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
FROM sounds
|
FROM sounds
|
||||||
WHERE server_id = ?
|
WHERE server_id = ?
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC
|
||||||
LIMIT ?, ?
|
LIMIT ?, ?",
|
||||||
",
|
|
||||||
guild_id.into(),
|
guild_id.into(),
|
||||||
page * 25,
|
page * 25,
|
||||||
(page + 1) * 25
|
(page + 1) * 25
|
||||||
@ -360,8 +350,7 @@ SELECT name, id, public, server_id, uploader_id
|
|||||||
SELECT name, id, public, server_id, uploader_id
|
SELECT name, id, public, server_id, uploader_id
|
||||||
FROM sounds
|
FROM sounds
|
||||||
WHERE server_id = ?
|
WHERE server_id = ?
|
||||||
ORDER BY id DESC
|
ORDER BY id DESC",
|
||||||
",
|
|
||||||
guild_id.into()
|
guild_id.into()
|
||||||
)
|
)
|
||||||
.fetch_all(&self.database)
|
.fetch_all(&self.database)
|
||||||
@ -421,8 +410,7 @@ impl Sound {
|
|||||||
SELECT src
|
SELECT src
|
||||||
FROM sounds
|
FROM sounds
|
||||||
WHERE id = ?
|
WHERE id = ?
|
||||||
LIMIT 1
|
LIMIT 1",
|
||||||
",
|
|
||||||
self.id
|
self.id
|
||||||
)
|
)
|
||||||
.fetch_one(db_pool)
|
.fetch_one(db_pool)
|
||||||
@ -471,8 +459,7 @@ SELECT src
|
|||||||
"
|
"
|
||||||
SELECT COUNT(1) as count
|
SELECT COUNT(1) as count
|
||||||
FROM sounds
|
FROM sounds
|
||||||
WHERE uploader_id = ?
|
WHERE uploader_id = ?",
|
||||||
",
|
|
||||||
user_id
|
user_id
|
||||||
)
|
)
|
||||||
.fetch_one(db_pool)
|
.fetch_one(db_pool)
|
||||||
@ -495,8 +482,7 @@ SELECT COUNT(1) as count
|
|||||||
FROM sounds
|
FROM sounds
|
||||||
WHERE
|
WHERE
|
||||||
uploader_id = ? AND
|
uploader_id = ? AND
|
||||||
name = ?
|
name = ?",
|
||||||
",
|
|
||||||
user_id,
|
user_id,
|
||||||
name
|
name
|
||||||
)
|
)
|
||||||
@ -517,8 +503,7 @@ UPDATE sounds
|
|||||||
SET
|
SET
|
||||||
public = ?
|
public = ?
|
||||||
WHERE
|
WHERE
|
||||||
id = ?
|
id = ?",
|
||||||
",
|
|
||||||
self.public,
|
self.public,
|
||||||
self.id
|
self.id
|
||||||
)
|
)
|
||||||
@ -620,8 +605,7 @@ WHERE
|
|||||||
match sqlx::query!(
|
match sqlx::query!(
|
||||||
"
|
"
|
||||||
INSERT INTO sounds (name, server_id, uploader_id, public, src)
|
INSERT INTO sounds (name, server_id, uploader_id, public, src)
|
||||||
VALUES (?, ?, ?, 1, ?)
|
VALUES (?, ?, ?, 1, ?)",
|
||||||
",
|
|
||||||
name,
|
name,
|
||||||
server_id,
|
server_id,
|
||||||
user_id,
|
user_id,
|
||||||
|
Loading…
Reference in New Issue
Block a user