mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-18 16:28:55 +00:00
Connect reaction watcher
This commit is contained in:
parent
486bd6b88d
commit
d8305df52a
1 changed files with 5 additions and 1 deletions
|
@ -2,7 +2,7 @@ use dotenv;
|
||||||
use dotenv::var;
|
use dotenv::var;
|
||||||
use serenity::{
|
use serenity::{
|
||||||
framework::standard::{DispatchError, StandardFramework},
|
framework::standard::{DispatchError, StandardFramework},
|
||||||
model::{channel::Message, gateway},
|
model::{channel::{Message, Reaction}, gateway},
|
||||||
};
|
};
|
||||||
use youmubot_prelude::*;
|
use youmubot_prelude::*;
|
||||||
|
|
||||||
|
@ -25,6 +25,10 @@ impl EventHandler for Handler {
|
||||||
println!("{:?}", message);
|
println!("{:?}", message);
|
||||||
self.hooks.iter().for_each(|f| f(&mut ctx, &message));
|
self.hooks.iter().for_each(|f| f(&mut ctx, &message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn reaction_add(&self, ctx: Context, reaction: Reaction) {
|
||||||
|
ctx.data.get_cloned::<ReactionWatcher>().send(reaction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue