fix permission checks
This commit is contained in:
parent
9d588e7e03
commit
50365c3215
@ -13,7 +13,7 @@ use crate::{
|
|||||||
slash_command,
|
slash_command,
|
||||||
rename = "upload",
|
rename = "upload",
|
||||||
category = "Manage",
|
category = "Manage",
|
||||||
required_permissions = "MANAGE_GUILD"
|
default_member_permissions = "MANAGE_GUILD"
|
||||||
)]
|
)]
|
||||||
pub async fn upload_new_sound(
|
pub async fn upload_new_sound(
|
||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
|
@ -10,7 +10,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Play a sound in your current voice channel
|
/// Play a sound in your current voice channel
|
||||||
#[poise::command(slash_command, required_permissions = "SPEAK")]
|
#[poise::command(slash_command, default_member_permissions = "SPEAK")]
|
||||||
pub async fn play(
|
pub async fn play(
|
||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
#[description = "Name or ID of sound to play"]
|
#[description = "Name or ID of sound to play"]
|
||||||
@ -36,7 +36,7 @@ pub async fn play(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Play up to 25 sounds on queue
|
/// Play up to 25 sounds on queue
|
||||||
#[poise::command(slash_command, rename = "queue", required_permissions = "SPEAK")]
|
#[poise::command(slash_command, rename = "queue", default_member_permissions = "SPEAK")]
|
||||||
pub async fn queue_play(
|
pub async fn queue_play(
|
||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
#[description = "Name or ID for queue position 1"]
|
#[description = "Name or ID for queue position 1"]
|
||||||
@ -197,7 +197,7 @@ pub async fn queue_play(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Loop a sound in your current voice channel
|
/// Loop a sound in your current voice channel
|
||||||
#[poise::command(slash_command, rename = "loop", required_permissions = "SPEAK")]
|
#[poise::command(slash_command, rename = "loop", default_member_permissions = "SPEAK")]
|
||||||
pub async fn loop_play(
|
pub async fn loop_play(
|
||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
#[description = "Name or ID of sound to loop"]
|
#[description = "Name or ID of sound to loop"]
|
||||||
@ -227,7 +227,7 @@ pub async fn loop_play(
|
|||||||
slash_command,
|
slash_command,
|
||||||
rename = "soundboard",
|
rename = "soundboard",
|
||||||
category = "Play",
|
category = "Play",
|
||||||
required_permissions = "SPEAK"
|
default_member_permissions = "SPEAK"
|
||||||
)]
|
)]
|
||||||
pub async fn soundboard(
|
pub async fn soundboard(
|
||||||
ctx: Context<'_>,
|
ctx: Context<'_>,
|
||||||
|
@ -3,7 +3,7 @@ use songbird;
|
|||||||
use crate::{Context, Error};
|
use crate::{Context, Error};
|
||||||
|
|
||||||
/// Stop the bot from playing and clear the play queue
|
/// Stop the bot from playing and clear the play queue
|
||||||
#[poise::command(slash_command, rename = "stop", required_permissions = "MANAGE_GUILD")]
|
#[poise::command(slash_command, rename = "stop", default_member_permissions = "SPEAK")]
|
||||||
pub async fn stop_playing(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn stop_playing(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let songbird = songbird::get(ctx.discord()).await.unwrap();
|
let songbird = songbird::get(ctx.discord()).await.unwrap();
|
||||||
let call_opt = songbird.get(ctx.guild_id().unwrap());
|
let call_opt = songbird.get(ctx.guild_id().unwrap());
|
||||||
@ -20,7 +20,7 @@ pub async fn stop_playing(ctx: Context<'_>) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Disconnect the bot
|
/// Disconnect the bot
|
||||||
#[poise::command(slash_command, required_permissions = "SPEAK")]
|
#[poise::command(slash_command, default_member_permissions = "SPEAK")]
|
||||||
pub async fn disconnect(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn disconnect(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let songbird = songbird::get(ctx.discord()).await.unwrap();
|
let songbird = songbird::get(ctx.discord()).await.unwrap();
|
||||||
let _ = songbird.leave(ctx.guild_id().unwrap()).await;
|
let _ = songbird.leave(ctx.guild_id().unwrap()).await;
|
||||||
|
Loading…
Reference in New Issue
Block a user