diff options
| author | seth <[email protected]> | 2023-04-07 19:59:19 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-04-07 20:00:57 -0400 |
| commit | bb3df7e6ab9de4c52fbe81b589ac5d1add6d281d (patch) | |
| tree | d0642d24fe96e8ea6d98969a20975b611ec11d53 /src/main.rs | |
| parent | 83f885ee8d762551a6c5d8ea5ab3719cde76464a (diff) | |
add random lore command
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 1d39fa5..927e0e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ const GUILD: u64 = 1055663552679137310; const BOT: u64 = 1056467120986271764; #[group] -#[commands(bing, ask, random_teawie, teawiespam)] +#[commands(bing, ask, random_lore, random_teawie, teawiespam)] struct General; struct Handler; @@ -62,6 +62,7 @@ impl EventHandler for Handler { commands::copypasta::run(&command.data.options, command.channel_id, &ctx.http) .await } + "random_lore" => commands::random_lore::run(&command.data.options).await, "random_teawie" => commands::random_teawie::run(&command.data.options).await, _ => "not implemented :(".to_string(), }; @@ -89,8 +90,9 @@ impl EventHandler for Handler { .create_application_command(|command| commands::ask::register(command)) .create_application_command(|command| commands::bottom_decode::register(command)) .create_application_command(|command| commands::bottom_encode::register(command)) - .create_application_command(|command| commands::random_teawie::register(command)) .create_application_command(|command| commands::copypasta::register(command)) + .create_application_command(|command| commands::random_lore::register(command)) + .create_application_command(|command| commands::random_teawie::register(command)) }) .await; @@ -138,6 +140,16 @@ async fn ask(ctx: &Context, msg: &Message) -> CommandResult { } #[command] +async fn random_lore(ctx: &Context, msg: &Message) -> CommandResult { + let resp = utils::get_random_lore().await; + msg.channel_id + .send_message(&ctx.http, |m| m.content(resp)) + .await?; + + Ok(()) +} + +#[command] async fn random_teawie(ctx: &Context, msg: &Message) -> CommandResult { let resp = api::guzzle::get_random_teawie().await; msg.channel_id |
