use crate::{Context, Error};
use poise::serenity_prelude as serenity;
#[poise::command(
slash_command,
install_context = "Guild|User",
interaction_context = "Guild|BotDm|PrivateChannel"
)]
pub async fn everywhere(ctx: Context<'_>) -> Result<(), Error> {
ctx.say("This command is available everywhere!").await?;
Ok(())
}
#[poise::command(
context_menu_command = "Everywhere",
install_context = "Guild|User",
interaction_context = "Guild|BotDm|PrivateChannel"
)]
pub async fn everywhere_context(ctx: Context<'_>, msg: serenity::Message) -> Result<(), Error> {
msg.reply(ctx, "This context menu is available everywhere!")
.await?;
Ok(())
}
#[poise::command(
slash_command,
install_context = "User",
interaction_context = "Guild|BotDm|PrivateChannel"
)]
pub async fn user_install(ctx: Context<'_>) -> Result<(), Error> {
ctx.say("This command is available only with a user install!")
.await?;
Ok(())
}
#[poise::command(
slash_command,
install_context = "User",
interaction_context = "BotDm|PrivateChannel"
)]
pub async fn not_in_guilds(ctx: Context<'_>) -> Result<(), Error> {
ctx.say("This command is not available in guilds!").await?;
Ok(())
}
#[poise::command(slash_command, install_context = "User", interaction_context = "Guild")]
pub async fn user_install_guild(ctx: Context<'_>) -> Result<(), Error> {
ctx.say("This command is available in guilds only with a user install!")
.await?;
Ok(())
}