feat: add descriptions to commands & arguments
Signed-off-by: seth <getchoo@tuta.io>
This commit is contained in:
parent
6e33299af7
commit
8bad9d9636
7 changed files with 19 additions and 5 deletions
|
@ -3,6 +3,7 @@ use crate::Context;
|
||||||
|
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
|
|
||||||
|
/// It's a joke
|
||||||
#[poise::command(slash_command, prefix_command)]
|
#[poise::command(slash_command, prefix_command)]
|
||||||
pub async fn joke(ctx: Context<'_>) -> Result<()> {
|
pub async fn joke(ctx: Context<'_>) -> Result<()> {
|
||||||
let joke = dadjoke::get_joke().await?;
|
let joke = dadjoke::get_joke().await?;
|
||||||
|
|
|
@ -2,6 +2,7 @@ use crate::{consts, Context};
|
||||||
|
|
||||||
use color_eyre::eyre::{eyre, Result};
|
use color_eyre::eyre::{eyre, Result};
|
||||||
|
|
||||||
|
/// Returns the number of members in the server
|
||||||
#[poise::command(slash_command, prefix_command)]
|
#[poise::command(slash_command, prefix_command)]
|
||||||
pub async fn members(ctx: Context<'_>) -> Result<()> {
|
pub async fn members(ctx: Context<'_>) -> Result<()> {
|
||||||
let guild = ctx.guild().ok_or_else(|| eyre!("Couldn't fetch guild!"))?;
|
let guild = ctx.guild().ok_or_else(|| eyre!("Couldn't fetch guild!"))?;
|
||||||
|
|
|
@ -2,6 +2,7 @@ use crate::Context;
|
||||||
|
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
|
|
||||||
|
/// Replies with pong!
|
||||||
#[poise::command(slash_command, prefix_command, ephemeral)]
|
#[poise::command(slash_command, prefix_command, ephemeral)]
|
||||||
pub async fn ping(ctx: Context<'_>) -> Result<()> {
|
pub async fn ping(ctx: Context<'_>) -> Result<()> {
|
||||||
ctx.reply("Pong!").await?;
|
ctx.reply("Pong!").await?;
|
||||||
|
|
|
@ -3,8 +3,12 @@ use crate::Context;
|
||||||
|
|
||||||
use color_eyre::eyre::Result;
|
use color_eyre::eyre::Result;
|
||||||
|
|
||||||
|
/// Gets a Rory photo!
|
||||||
#[poise::command(slash_command, prefix_command)]
|
#[poise::command(slash_command, prefix_command)]
|
||||||
pub async fn rory(ctx: Context<'_>, id: Option<u64>) -> Result<()> {
|
pub async fn rory(
|
||||||
|
ctx: Context<'_>,
|
||||||
|
#[description = "specify a Rory ID"] id: Option<u64>,
|
||||||
|
) -> Result<()> {
|
||||||
let resp = get_rory(id).await?;
|
let resp = get_rory(id).await?;
|
||||||
|
|
||||||
ctx.send(|m| {
|
ctx.send(|m| {
|
||||||
|
|
|
@ -2,8 +2,14 @@ use crate::Context;
|
||||||
|
|
||||||
use color_eyre::eyre::{eyre, Result};
|
use color_eyre::eyre::{eyre, Result};
|
||||||
|
|
||||||
#[poise::command(slash_command, prefix_command, ephemeral)]
|
/// Say something through the bot
|
||||||
pub async fn say(ctx: Context<'_>, content: String) -> Result<()> {
|
#[poise::command(
|
||||||
|
slash_command,
|
||||||
|
prefix_command,
|
||||||
|
ephemeral,
|
||||||
|
default_member_permissions = "MODERATE_MEMBERS"
|
||||||
|
)]
|
||||||
|
pub async fn say(ctx: Context<'_>, #[description = "Just content?"] content: String) -> Result<()> {
|
||||||
let guild = ctx.guild().ok_or_else(|| eyre!("Couldn't get guild!"))?;
|
let guild = ctx.guild().ok_or_else(|| eyre!("Couldn't get guild!"))?;
|
||||||
let channel = ctx
|
let channel = ctx
|
||||||
.guild_channel()
|
.guild_channel()
|
||||||
|
|
|
@ -2,6 +2,7 @@ use crate::{consts::COLORS, Context};
|
||||||
|
|
||||||
use color_eyre::eyre::{Context as _, Result};
|
use color_eyre::eyre::{Context as _, Result};
|
||||||
|
|
||||||
|
/// Returns GitHub stargazer count
|
||||||
#[poise::command(slash_command, prefix_command)]
|
#[poise::command(slash_command, prefix_command)]
|
||||||
pub async fn stars(ctx: Context<'_>) -> Result<()> {
|
pub async fn stars(ctx: Context<'_>) -> Result<()> {
|
||||||
let prismlauncher = ctx
|
let prismlauncher = ctx
|
||||||
|
|
|
@ -22,7 +22,7 @@ fn create_moderation_embed(
|
||||||
|e: &mut CreateEmbed| e.title(title).fields(fields).color(COLORS["red"])
|
|e: &mut CreateEmbed| e.title(title).fields(fields).color(COLORS["red"])
|
||||||
}
|
}
|
||||||
|
|
||||||
// ban a user
|
/// Ban a user
|
||||||
#[poise::command(
|
#[poise::command(
|
||||||
slash_command,
|
slash_command,
|
||||||
prefix_command,
|
prefix_command,
|
||||||
|
@ -54,7 +54,7 @@ pub async fn ban_user(
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
// kick a user
|
/// Kick a user
|
||||||
#[poise::command(
|
#[poise::command(
|
||||||
slash_command,
|
slash_command,
|
||||||
prefix_command,
|
prefix_command,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue