Skip to content

Commit

Permalink
Fix initial starboard message being off by 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Kile committed Mar 18, 2024
1 parent d130672 commit 5971f37
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/commands/bingo_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ A quirky GIF is in the slides
Takes less than 1 minute for a slide that needed much more time
Skype mention
Uses 3+ different types of bullet points
Flashing stuff on slides
Compliments someone's voice
Highlights a single dot
3 changes: 2 additions & 1 deletion src/events/dot_remover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const DOTS: [StrOrChar<&str>; 27] = [
];

fn remove_whitespace_from_end(text: &str, dot: &StrOrChar<&str>) -> String {
const WHITESPACE: [StrOrChar<&str>; 20] = [
const WHITESPACE: [StrOrChar<&str>; 21] = [
StrOrChar::Char('\u{2000}'),
StrOrChar::Char('\u{2001}'),
StrOrChar::Char('\u{2003}'),
Expand All @@ -105,6 +105,7 @@ fn remove_whitespace_from_end(text: &str, dot: &StrOrChar<&str>) -> String {
StrOrChar::Char('\u{3164}'),
StrOrChar::Str(r"_[ \n]*_"),
StrOrChar::Str(r"\|\|[ \n]*\|\|"),
StrOrChar::Str(r"<sound:\d+>")
];

let mut owned_text = text.to_owned().to_string();
Expand Down
7 changes: 1 addition & 6 deletions src/events/star.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ fn make_starboard_embed(message: &Message) -> CreateEmbed {
let mut embed = CreateEmbed::default()
.title(format!(
"{} 🌟",
message
.reactions
.iter()
.filter(|r| r.reaction_type == ReactionType::Unicode("⭐".to_string()))
.count()
+ 1
MIN_STARS
))
.author(
CreateEmbedAuthor::new(&message.author.name)
Expand Down

0 comments on commit 5971f37

Please sign in to comment.