Skip to content

Commit

Permalink
Starboard: Fix wizard
Browse files Browse the repository at this point in the history
Wasn't using the new reaction emoji checker.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Jun 30, 2023
1 parent b2d9bed commit b671db2
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/commands/starboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,20 +248,24 @@ async fn wizard(ctx: &Context, msg: &Message) -> CommandResult {
Some(action) => {
let reaction = action.as_inner_ref();

let reaction_emoji = &reaction.emoji.as_data();

if reaction_emoji == "✅" {
let pool = ctx
.data
.read()
.await
.get::<ConnectionPool>()
.cloned()
.unwrap();

starboard_wizard_threshold(ctx, msg, &pool).await?
} else if reaction_emoji == "❌" {
msg.channel_id.say(ctx, "Aborting...").await?;
if let ReactionType::Unicode(emoji) = &reaction.emoji {
if emoji == "✅" {
let pool = ctx
.data
.read()
.await
.get::<ConnectionPool>()
.cloned()
.unwrap();

starboard_wizard_threshold(ctx, msg, &pool).await?
} else if emoji == "❌" {
msg.channel_id.say(ctx, "Aborting...").await?;
} else {
msg.channel_id
.say(ctx, "That's not a valid emoji! Aborting...")
.await?;
}
} else {
msg.channel_id
.say(ctx, "That's not a valid emoji! Aborting...")
Expand Down

0 comments on commit b671db2

Please sign in to comment.