add distinct identifying names. log errors in run_macro

This commit is contained in:
jude
2022-02-20 12:19:39 +00:00
parent 06c4deeaa9
commit 6ae2353c92
7 changed files with 102 additions and 40 deletions

View File

@ -39,7 +39,7 @@ use crate::{
};
/// Pause all reminders on the current channel until a certain time or indefinitely
#[poise::command(slash_command)]
#[poise::command(slash_command, identifying_name = "pause")]
pub async fn pause(
ctx: Context<'_>,
#[description = "When to pause until"] until: Option<String>,
@ -90,7 +90,7 @@ pub async fn pause(
}
/// Move all reminders in the current server by a certain amount of time. Times get added together
#[poise::command(slash_command)]
#[poise::command(slash_command, identifying_name = "offset")]
pub async fn offset(
ctx: Context<'_>,
#[description = "Number of hours to offset by"] hours: Option<isize>,
@ -147,7 +147,7 @@ WHERE FIND_IN_SET(channels.`channel`, ?)",
}
/// Nudge all future reminders on this channel by a certain amount (don't use for DST! See `/offset`)
#[poise::command(slash_command)]
#[poise::command(slash_command, identifying_name = "nudge")]
pub async fn nudge(
ctx: Context<'_>,
#[description = "Number of minutes to nudge new reminders by"] minutes: Option<isize>,
@ -170,7 +170,7 @@ pub async fn nudge(
}
/// View reminders on a specific channel
#[poise::command(slash_command)]
#[poise::command(slash_command, identifying_name = "look")]
pub async fn look(
ctx: Context<'_>,
#[description = "Channel to view reminders on"] channel: Option<Channel>,
@ -260,7 +260,7 @@ pub async fn look(
}
/// Delete reminders
#[poise::command(slash_command, rename = "del")]
#[poise::command(slash_command, rename = "del", identifying_name = "delete")]
pub async fn delete(ctx: Context<'_>) -> Result<(), Error> {
let timezone = ctx.timezone().await;
@ -422,13 +422,13 @@ fn time_difference(start_time: NaiveDateTime) -> String {
}
/// Manage timers
#[poise::command(slash_command, rename = "timer")]
#[poise::command(slash_command, rename = "timer", identifying_name = "timer_base")]
pub async fn timer_base(_ctx: Context<'_>) -> Result<(), Error> {
Ok(())
}
/// List the timers in this server or DM channel
#[poise::command(slash_command, rename = "list")]
#[poise::command(slash_command, rename = "list", identifying_name = "list_timer")]
pub async fn list_timer(ctx: Context<'_>) -> Result<(), Error> {
let owner = ctx.guild_id().map(|g| g.0).unwrap_or_else(|| ctx.author().id.0);
@ -452,7 +452,7 @@ pub async fn list_timer(ctx: Context<'_>) -> Result<(), Error> {
}
/// Start a new timer from now
#[poise::command(slash_command, rename = "start")]
#[poise::command(slash_command, rename = "start", identifying_name = "start_timer")]
pub async fn start_timer(
ctx: Context<'_>,
#[description = "Name for the new timer"] name: String,
@ -482,7 +482,7 @@ pub async fn start_timer(
}
/// Delete a timer
#[poise::command(slash_command, rename = "delete")]
#[poise::command(slash_command, rename = "delete", identifying_name = "delete_timer")]
pub async fn delete_timer(
ctx: Context<'_>,
#[description = "Name of timer to delete"] name: String,
@ -509,8 +509,8 @@ pub async fn delete_timer(
}
/// Create a new reminder
#[poise::command(slash_command)]
pub(crate) async fn remind(
#[poise::command(slash_command, identifying_name = "remind")]
pub async fn remind(
ctx: Context<'_>,
#[description = "A description of the time to set the reminder for"] time: String,
#[description = "The message content to send"] content: String,