Partially add ephemeral commands, remove rebuildSite
This commit is contained in:
parent
2c4b7bc344
commit
ebcb6e2ff7
4 changed files with 10 additions and 14 deletions
|
@ -15,6 +15,7 @@ use std::path::Path;
|
|||
#[command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
ephemeral,
|
||||
description_localized("en-US", "View the latest handwriting challenge info.")
|
||||
)]
|
||||
pub async fn challenge(ctx: Context<'_>) -> Result<(), Error> {
|
||||
|
@ -187,6 +188,7 @@ pub async fn submit(ctx: PrefixContext<'_>) -> Result<(), Error> {
|
|||
#[command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
ephemeral,
|
||||
description_localized("en-US", "List images in your current submission, if available.")
|
||||
)]
|
||||
pub async fn images(ctx: Context<'_>) -> Result<(), Error> {
|
||||
|
@ -231,6 +233,7 @@ pub async fn images(ctx: Context<'_>) -> Result<(), Error> {
|
|||
#[command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
ephemeral,
|
||||
description_localized(
|
||||
"en-US",
|
||||
"Delete images from your current submission using image numbers from the images command."
|
||||
|
|
|
@ -9,6 +9,7 @@ use std::env;
|
|||
#[command(
|
||||
prefix_command,
|
||||
slash_command,
|
||||
ephemeral,
|
||||
description_localized("en-US", "Get help for the 字ちゃん Tegaki Tuesday bot")
|
||||
)]
|
||||
pub async fn help(ctx: Context<'_>) -> Result<(), Error> {
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::env;
|
|||
|
||||
use crate::utils::*;
|
||||
|
||||
#[command(prefix_command, hide_in_help, owners_only)]
|
||||
#[command(prefix_command, slash_command, hide_in_help, ephemeral, owners_only)]
|
||||
pub async fn sleep(ctx: Context<'_>) -> Result<(), crate::Error> {
|
||||
ctx.say("Good night!").await?;
|
||||
ctx.framework()
|
||||
|
@ -21,7 +21,7 @@ pub async fn sleep(ctx: Context<'_>) -> Result<(), crate::Error> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[command(prefix_command, hide_in_help, owners_only)]
|
||||
#[command(prefix_command, slash_command, hide_in_help, ephemeral, owners_only)]
|
||||
pub async fn setsubmissionchannel(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let mut guild_data = get_guild_data();
|
||||
let guild = ctx.guild_id().unwrap().as_u64().to_string();
|
||||
|
@ -47,7 +47,7 @@ pub async fn setsubmissionchannel(ctx: Context<'_>) -> Result<(), Error> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[command(prefix_command, hide_in_help, owners_only)]
|
||||
#[command(prefix_command, slash_command, hide_in_help, ephemeral, owners_only)]
|
||||
pub async fn setsuggestionchannel(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let channel = ctx.channel_id().as_u64().to_string();
|
||||
let message = format!("Submission channel set to <#{}>.", channel);
|
||||
|
@ -62,7 +62,7 @@ pub async fn setsuggestionchannel(ctx: Context<'_>) -> Result<(), Error> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[command(prefix_command, hide_in_help, owners_only)]
|
||||
#[command(prefix_command, slash_command, hide_in_help, ephemeral, owners_only)]
|
||||
#[allow(non_snake_case)]
|
||||
pub async fn setannouncementrole(
|
||||
ctx: Context<'_>,
|
||||
|
@ -86,7 +86,7 @@ pub async fn setannouncementrole(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[command(prefix_command, hide_in_help, owners_only)]
|
||||
#[command(prefix_command, slash_command, hide_in_help, ephemeral, owners_only)]
|
||||
pub async fn announce(
|
||||
ctx: Context<'_>,
|
||||
#[description = "Announcement text"] announcement: String,
|
||||
|
@ -94,7 +94,7 @@ pub async fn announce(
|
|||
send(ctx, &announcement, true, false).await
|
||||
}
|
||||
|
||||
#[command(prefix_command, hide_in_help, owners_only)]
|
||||
#[command(prefix_command, slash_command, hide_in_help, ephemeral, owners_only)]
|
||||
pub async fn announcechallenge(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let challenge_number = get_challenge_number();
|
||||
let message = format!("Welcome to the **{n}{th}** weekly **Tegaki Tuesday** (手書きの火曜日) handwriting challenge! :pen_fountain: The prompt is available in both Japanese and English on the website at <https://tegakituesday.com/{n}>.
|
||||
|
@ -113,10 +113,3 @@ You can make submissions in both languages, but please submit in your target lan
|
|||
ctx.say("Announced!").await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command(prefix_command, hide_in_help, owners_only)]
|
||||
pub async fn rebuildsite(ctx: Context<'_>) -> Result<(), Error> {
|
||||
rebuild_site();
|
||||
ctx.say("Started site rebuild process!").await?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -41,7 +41,6 @@ async fn main() {
|
|||
setannouncementrole(),
|
||||
announce(),
|
||||
announcechallenge(),
|
||||
rebuildsite(),
|
||||
// challenge
|
||||
challenge(),
|
||||
submit(),
|
||||
|
|
Loading…
Add table
Reference in a new issue