Update dependencies and add watame command

Signed-off-by: trivernis <trivernis@protonmail.com>
feature/more-hololive-commands
trivernis 3 years ago
parent 6b07e16c3f
commit 099101a255
Signed by: Trivernis
GPG Key ID: DFFFCC2C7A02DB45

524
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -112,6 +112,13 @@ async fn after_hook(ctx: &Context, msg: &Message, cmd_name: &str, error: Command
let mut error_msg = None;
if let Err(why) = error {
error_msg = Some(why.to_string());
if let Some(e) = why.downcast_ref::<BotError>() {
match e {
_ => {
println!("Got a bot error")
}
}
}
let _ = msg
.channel_id
.send_message(ctx, |m| {

@ -0,0 +1,7 @@
pub mod fubuki;
pub mod korone;
pub mod matsuri;
pub mod miko;
pub mod pekofy;
pub mod rushia;
pub mod watame;

@ -0,0 +1,14 @@
use crate::commands::weeb::post_random_media;
use serenity::client::Context;
use serenity::framework::standard::macros::command;
use serenity::framework::standard::CommandResult;
use serenity::model::channel::Message;
#[command]
#[description("Posts a random rushia")]
#[usage("")]
#[aliases("wataoji", "wata-oji", "watamelon")]
#[bucket("general")]
async fn watame(ctx: &Context, msg: &Message) -> CommandResult {
post_random_media(ctx, msg, "watame").await
}

@ -1,32 +1,28 @@
use serenity::framework::standard::macros::group;
mod fubuki;
mod korone;
mod matsuri;
mod miko;
mod pekofy;
mod rushia;
mod sauce;
mod theme;
use crate::utils::context_data::get_database_from_context;
use crate::utils::error::BotError;
use rand::prelude::IteratorRandom;
use serenity::client::Context;
use serenity::framework::standard::macros::group;
use serenity::framework::standard::CommandResult;
use serenity::model::channel::Message;
use fubuki::FUBUKI_COMMAND;
use korone::KORONE_COMMAND;
use matsuri::MATSURI_COMMAND;
use miko::MIKO_COMMAND;
use pekofy::PEKOFY_COMMAND;
use rushia::RUSHIA_COMMAND;
use hololive::fubuki::FUBUKI_COMMAND;
use hololive::korone::KORONE_COMMAND;
use hololive::matsuri::MATSURI_COMMAND;
use hololive::miko::MIKO_COMMAND;
use hololive::pekofy::PEKOFY_COMMAND;
use hololive::rushia::RUSHIA_COMMAND;
use hololive::watame::WATAME_COMMAND;
use sauce::SAUCE_COMMAND;
use theme::THEME_COMMAND;
use crate::utils::context_data::get_database_from_context;
use crate::utils::error::BotError;
mod hololive;
mod sauce;
mod theme;
#[group]
#[commands(pekofy, sauce, matsuri, korone, rushia, fubuki, miko, theme)]
#[commands(pekofy, sauce, matsuri, korone, rushia, fubuki, miko, theme, watame)]
pub struct Weeb;
/// Posts a random media entry with the given category

@ -37,7 +37,7 @@ pub async fn create_theme_menu(
false
}
})
.map(|e| create_theme_page(e, nsfw)),
.map(create_theme_page),
)
.timeout(EXTRA_LONG_TIMEOUT)
.build(ctx, channel_id)
@ -47,7 +47,7 @@ pub async fn create_theme_menu(
}
/// Creates a new anime theme page
fn create_theme_page(entry: ThemeEntry, nsfw: bool) -> Page<'static> {
fn create_theme_page(entry: ThemeEntry) -> Page<'static> {
let mut message = CreateMessage::default();
let videos = entry.videos.unwrap();
let theme = entry.theme.unwrap();

Loading…
Cancel
Save