Commit 341a5522 authored by tec's avatar tec

Simplify react adding

parent b060695b
...@@ -200,26 +200,13 @@ fn create_motion(ctx: &Context, msg: &Message, topic: &str) { ...@@ -200,26 +200,13 @@ fn create_motion(ctx: &Context, msg: &Message, topic: &str) {
embed.field("Votes", "For: 0\nAgainst: 0\nAbstain: 0", true); embed.field("Votes", "For: 0\nAgainst: 0\nAbstain: 0", true);
embed embed
}); });
m.reactions(&[ m.reactions(vec![FOR_VOTE, AGAINST_VOTE, ABSTAIN_VOTE]);
FOR_VOTE.to_string().into(channel::ReactionType),
AGAINST_VOTE.to_string().into(channel::ReactionType),
ABSTAIN_VOTE.to_string().into(channel::ReactionType),
]);
m m
}) { }) {
Err(why) => { Err(why) => {
println!("Error sending message: {:?}", why); println!("Error sending message: {:?}", why);
} }
Ok(message) => { Ok(message) => {
if let Err(why) = msg.delete(ctx) {
println!("Error deleting motion prompt: {:?}", why);
}
if let Err(why) = message.react(ctx, FOR_VOTE) {
println!("Error sending 👍 react: {:?}", why);
}
if let Err(why) = message.react(ctx, AGAINST_VOTE) {
println!("Error sending 👎 react: {:?}", why);
}
if let Err(why) = message.react(ctx, ABSTAIN_VOTE) { if let Err(why) = message.react(ctx, ABSTAIN_VOTE) {
println!("Error sending 🙊 react: {:?}", why); println!("Error sending 🙊 react: {:?}", why);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment