Merge pull request #32 from Trivernis/feature/more-hololive-commands

Feature/more hololive commands
pull/33/head
Julius Riegel 3 years ago committed by GitHub
commit b7764d477d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

526
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
[package]
name = "tobi-rs"
version = "0.8.1"
version = "0.8.2"
authors = ["trivernis <trivernis@protonmail.com>"]
edition = "2018"

@ -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,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 amelia")]
#[usage("")]
#[aliases("ame", "ground-pounder")]
#[bucket("general")]
async fn amelia(ctx: &Context, msg: &Message) -> CommandResult {
post_random_media(ctx, msg, "amelia").await
}

@ -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 gura")]
#[usage("")]
#[aliases("shark", "city-pop-shark", "same")]
#[bucket("general")]
async fn gura(ctx: &Context, msg: &Message) -> CommandResult {
post_random_media(ctx, msg, "gura").await
}

@ -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 haachama")]
#[usage("")]
#[aliases("haato", "akai-haato", "haaaaaaaaaaaaaachama")]
#[bucket("general")]
async fn haachama(ctx: &Context, msg: &Message) -> CommandResult {
post_random_media(ctx, msg, "haachama").await
}

@ -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 ina")]
#[usage("")]
#[aliases("ina", "ina'nis", "tako")]
#[bucket("general")]
async fn inanis(ctx: &Context, msg: &Message) -> CommandResult {
post_random_media(ctx, msg, "inanis").await
}

@ -0,0 +1,13 @@
pub mod amelia;
pub mod fubuki;
pub mod gura;
pub mod haachama;
pub mod inanis;
pub mod korone;
pub mod matsuri;
pub mod miko;
pub mod nene;
pub mod pekofy;
pub mod polka;
pub mod rushia;
pub mod watame;

@ -0,0 +1,17 @@
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 nenechi")]
#[usage("")]
#[aliases(
"nenechi", "suzumomo", "supernenechi",
"super-hyper-ultra-ultimate-deluxe-perfect-amazing-shining-god-東方不敗-master-ginga-victory-strong-cute-beautiful-galaxy-baby-無限-無敵-無双-nenechi"
)]
#[bucket("general")]
async fn nene(ctx: &Context, msg: &Message) -> CommandResult {
post_random_media(ctx, msg, "nene").await
}

@ -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 pol")]
#[usage("")]
#[aliases("pol", "omarun", "omapol")]
#[bucket("general")]
async fn polka(ctx: &Context, msg: &Message) -> CommandResult {
post_random_media(ctx, msg, "polka").await
}

@ -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 watame")]
#[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,37 @@
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::amelia::AMELIA_COMMAND;
use hololive::fubuki::FUBUKI_COMMAND;
use hololive::gura::GURA_COMMAND;
use hololive::haachama::HAACHAMA_COMMAND;
use hololive::inanis::INANIS_COMMAND;
use hololive::korone::KORONE_COMMAND;
use hololive::matsuri::MATSURI_COMMAND;
use hololive::miko::MIKO_COMMAND;
use hololive::nene::NENE_COMMAND;
use hololive::pekofy::PEKOFY_COMMAND;
use hololive::polka::POLKA_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, inanis, gura, amelia,
haachama, polka, nene
)]
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