help command. moved list commands to subcommands
This commit is contained in:
parent
b350007dae
commit
d59c50e7a9
@ -1,7 +1,59 @@
|
|||||||
use crate::{consts::THEME_COLOR, Context, Error};
|
use crate::{consts::THEME_COLOR, Context, Error};
|
||||||
|
|
||||||
|
/// View bot commands
|
||||||
|
#[poise::command(slash_command)]
|
||||||
|
pub async fn help(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
|
ctx.send(|m| {
|
||||||
|
m.embed(|e| {
|
||||||
|
e.title("Help")
|
||||||
|
.color(THEME_COLOR)
|
||||||
|
.footer(|f| {
|
||||||
|
f.text(concat!(
|
||||||
|
env!("CARGO_PKG_NAME"),
|
||||||
|
" ver ",
|
||||||
|
env!("CARGO_PKG_VERSION")
|
||||||
|
))
|
||||||
|
})
|
||||||
|
.description(
|
||||||
|
"__Info Commands__
|
||||||
|
`/help` `/info`
|
||||||
|
*run these commands with no options*
|
||||||
|
|
||||||
|
__Play Commands__
|
||||||
|
`/play` - Play a sound by name or ID
|
||||||
|
`/loop` - Play a sound on loop
|
||||||
|
`/disconnect` - Disconnect the bot
|
||||||
|
`/stop` - Stop playback
|
||||||
|
|
||||||
|
__Library Commands__
|
||||||
|
`/upload` - Upload a sound file
|
||||||
|
`/delete` - Delete a sound file
|
||||||
|
`/download` - Download a sound file
|
||||||
|
`/public` - Set a sound as public/private
|
||||||
|
`/list server` - List sounds on this server
|
||||||
|
`/list user` - List your sounds
|
||||||
|
|
||||||
|
__Search Commands__
|
||||||
|
`/search` - Search for public sounds by name
|
||||||
|
`/random` - View random public sounds
|
||||||
|
|
||||||
|
__Setting Commands__
|
||||||
|
`/greet set/unset` - Set or unset a join sound
|
||||||
|
`/greet enable/disable` - Enable or disable join sounds on this server
|
||||||
|
`/volume` - Change the volume
|
||||||
|
|
||||||
|
__Advanced Commands__
|
||||||
|
`/soundboard` - Create a soundboard",
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
/// Get additional information about the bot
|
/// Get additional information about the bot
|
||||||
#[poise::command(slash_command, category = "Information")]
|
#[poise::command(slash_command)]
|
||||||
pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let current_user = ctx.discord().cache.current_user();
|
let current_user = ctx.discord().cache.current_user();
|
||||||
|
|
||||||
@ -11,11 +63,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
|
|||||||
.color(THEME_COLOR)
|
.color(THEME_COLOR)
|
||||||
.footer(|f| f
|
.footer(|f| f
|
||||||
.text(concat!(env!("CARGO_PKG_NAME"), " ver ", env!("CARGO_PKG_VERSION"))))
|
.text(concat!(env!("CARGO_PKG_NAME"), " ver ", env!("CARGO_PKG_VERSION"))))
|
||||||
.description(format!("Default prefix: `?`
|
.description(format!("Invite me: https://discord.com/api/oauth2/authorize?client_id={}&permissions=3165184&scope=applications.commands%20bot
|
||||||
|
|
||||||
Reset prefix: `@{0} prefix ?`
|
|
||||||
|
|
||||||
Invite me: https://discord.com/api/oauth2/authorize?client_id={1}&permissions=3165184&scope=applications.commands%20bot
|
|
||||||
|
|
||||||
**Welcome to SoundFX!**
|
**Welcome to SoundFX!**
|
||||||
Developer: <@203532103185465344>
|
Developer: <@203532103185465344>
|
||||||
@ -23,7 +71,6 @@ Find me on https://discord.jellywx.com/ and on https://github.com/JellyWX :)
|
|||||||
|
|
||||||
**An online dashboard is available!** Visit https://soundfx.jellywx.com/dashboard
|
**An online dashboard is available!** Visit https://soundfx.jellywx.com/dashboard
|
||||||
There is a maximum sound limit per user. This can be removed by subscribing at **https://patreon.com/jellywx**",
|
There is a maximum sound limit per user. This can be removed by subscribing at **https://patreon.com/jellywx**",
|
||||||
current_user.name,
|
|
||||||
current_user.id.as_u64())))).await?;
|
current_user.id.as_u64())))).await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -26,9 +26,15 @@ fn format_search_results<'a>(search_results: Vec<Sound>) -> CreateReply<'a> {
|
|||||||
builder
|
builder
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Show the sounds uploaded to this server
|
/// Show uploaded sounds
|
||||||
#[poise::command(slash_command, rename = "list")]
|
#[poise::command(slash_command, rename = "list")]
|
||||||
pub async fn list_sounds(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn list_sounds(_ctx: Context<'_>) -> Result<(), Error> {
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Show the sounds uploaded to this server
|
||||||
|
#[poise::command(slash_command, rename = "server")]
|
||||||
|
pub async fn list_guild_sounds(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let sounds;
|
let sounds;
|
||||||
let mut message_buffer;
|
let mut message_buffer;
|
||||||
|
|
||||||
@ -62,7 +68,7 @@ pub async fn list_sounds(ctx: Context<'_>) -> Result<(), Error> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Show all sounds you have uploaded
|
/// Show all sounds you have uploaded
|
||||||
#[poise::command(slash_command, rename = "me")]
|
#[poise::command(slash_command, rename = "user")]
|
||||||
pub async fn list_user_sounds(ctx: Context<'_>) -> Result<(), Error> {
|
pub async fn list_user_sounds(ctx: Context<'_>) -> Result<(), Error> {
|
||||||
let sounds;
|
let sounds;
|
||||||
let mut message_buffer;
|
let mut message_buffer;
|
||||||
|
11
src/main.rs
11
src/main.rs
@ -76,6 +76,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
|||||||
|
|
||||||
let options = poise::FrameworkOptions {
|
let options = poise::FrameworkOptions {
|
||||||
commands: vec![
|
commands: vec![
|
||||||
|
cmds::info::help(),
|
||||||
cmds::info::info(),
|
cmds::info::info(),
|
||||||
cmds::manage::change_public(),
|
cmds::manage::change_public(),
|
||||||
cmds::manage::upload_new_sound(),
|
cmds::manage::upload_new_sound(),
|
||||||
@ -84,8 +85,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
|||||||
cmds::play::play(),
|
cmds::play::play(),
|
||||||
cmds::play::loop_play(),
|
cmds::play::loop_play(),
|
||||||
cmds::play::soundboard(),
|
cmds::play::soundboard(),
|
||||||
cmds::search::list_sounds(),
|
poise::Command {
|
||||||
cmds::search::list_user_sounds(),
|
subcommands: vec![
|
||||||
|
cmds::search::list_guild_sounds(),
|
||||||
|
cmds::search::list_user_sounds(),
|
||||||
|
],
|
||||||
|
..cmds::search::list_sounds()
|
||||||
|
},
|
||||||
cmds::search::show_random_sounds(),
|
cmds::search::show_random_sounds(),
|
||||||
cmds::search::search_sounds(),
|
cmds::search::search_sounds(),
|
||||||
cmds::stop::stop_playing(),
|
cmds::stop::stop_playing(),
|
||||||
@ -97,7 +103,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
|||||||
cmds::settings::enable_greet_sound(),
|
cmds::settings::enable_greet_sound(),
|
||||||
cmds::settings::set_greet_sound(),
|
cmds::settings::set_greet_sound(),
|
||||||
cmds::settings::unset_greet_sound(),
|
cmds::settings::unset_greet_sound(),
|
||||||
cmds::settings::greet_sound(),
|
|
||||||
],
|
],
|
||||||
..cmds::settings::greet_sound()
|
..cmds::settings::greet_sound()
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user