Unverified Commit 7f8d9de1 authored by tec's avatar tec
Browse files

Add role-react deletion technology :)

parent a8e73b0b
...@@ -97,16 +97,25 @@ pub fn sync_all_role_reactions(ctx: &Context) { ...@@ -97,16 +97,25 @@ pub fn sync_all_role_reactions(ctx: &Context) {
for react in &message.reactions { for react in &message.reactions {
let react_as_string = get_string_from_react(&react.reaction_type); let react_as_string = get_string_from_react(&react.reaction_type);
if mapping.contains_key(&react_as_string) { if mapping.contains_key(&react_as_string) {
continue continue;
} }
info!( info!(
" message #{}: Removing non-role react '{}'", " message #{}: Removing non-role react '{}'",
i, react_as_string i, react_as_string
); );
for _illegal_react in for illegal_react_user in &message
&message.reaction_users(ctx, react.reaction_type.clone(), Some(100), None) .reaction_users(&ctx.http, react.reaction_type.clone(), Some(100), None)
.unwrap_or(vec![])
{ {
warn!(" need to implement react removal"); message
.channel_id
.delete_reaction(
&ctx.http,
message.id,
Some(illegal_react_user.id),
react.reaction_type.clone(),
)
.expect("Unable to delete react");
} }
} }
for (react, role) in *mapping { for (react, role) in *mapping {
......
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