add reeeee
This commit is contained in:
parent
b7bb17a42c
commit
ea414b0577
2 changed files with 31 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
use ahhhh::YellResponder;
|
use ahhhh::YellResponder;
|
||||||
use best_doctor::BestDoctorResponder;
|
use best_doctor::BestDoctorResponder;
|
||||||
use fufufu::FufufuResponder;
|
use fufufu::FufufuResponder;
|
||||||
|
use reee::ReeeResponder;
|
||||||
use serenity::async_trait;
|
use serenity::async_trait;
|
||||||
use serenity::model::channel::Message;
|
use serenity::model::channel::Message;
|
||||||
use serenity::prelude::{Context, EventHandler};
|
use serenity::prelude::{Context, EventHandler};
|
||||||
|
@ -8,6 +9,7 @@ use serenity::prelude::{Context, EventHandler};
|
||||||
mod ahhhh;
|
mod ahhhh;
|
||||||
mod best_doctor;
|
mod best_doctor;
|
||||||
mod fufufu;
|
mod fufufu;
|
||||||
|
mod reee;
|
||||||
|
|
||||||
pub(crate) struct Handler {
|
pub(crate) struct Handler {
|
||||||
responders: Vec<Box<dyn EventHandler>>,
|
responders: Vec<Box<dyn EventHandler>>,
|
||||||
|
@ -20,6 +22,7 @@ impl Default for Handler {
|
||||||
Box::new(BestDoctorResponder),
|
Box::new(BestDoctorResponder),
|
||||||
Box::new(FufufuResponder),
|
Box::new(FufufuResponder),
|
||||||
Box::new(YellResponder),
|
Box::new(YellResponder),
|
||||||
|
Box::new(ReeeResponder),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
28
src/passive/reee.rs
Normal file
28
src/passive/reee.rs
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
use regex::Regex;
|
||||||
|
use serenity::async_trait;
|
||||||
|
use serenity::model::channel::Message;
|
||||||
|
use serenity::prelude::{Context, EventHandler};
|
||||||
|
|
||||||
|
lazy_static! {
|
||||||
|
static ref REGEX: Regex = Regex::new("RE{5,}").unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
pub(crate) struct ReeeResponder;
|
||||||
|
|
||||||
|
#[async_trait]
|
||||||
|
impl EventHandler for ReeeResponder {
|
||||||
|
async fn message(&self, ctx: Context, message: Message) {
|
||||||
|
if REGEX.is_match(&message.content_safe(ctx.clone()).await) {
|
||||||
|
if let Some(guild_id) = message.guild_id {
|
||||||
|
if guild_id == 679888177951277102 {
|
||||||
|
message
|
||||||
|
.channel_id
|
||||||
|
.say(ctx, "<:texaspat:680231475928498217>")
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue