use serenity::model::prelude::{Message, ReactionType};
use serenity::prelude::Context;
use serenity::Error;
pub async fn add_reactions(
ctx: &Context,
msg: &Message,
emojis: Vec<ReactionType>,
) -> Result<(), Error> {
let channel_id = msg.channel_id;
let msg_id = msg.id;
let http = ctx.http.clone();
tokio::spawn(async move {
for emoji in emojis {
http.create_reaction(channel_id.0, msg_id.0, &emoji).await?;
}
Result::<_, Error>::Ok(())
});
Ok(())
}
pub async fn add_reactions_blocking(
ctx: &Context,
msg: &Message,
emojis: &[ReactionType],
) -> Result<(), Error> {
for emoji in emojis {
ctx.http.create_reaction(msg.channel_id.0, msg.id.0, emoji).await?;
}
Ok(())
}