Skip to content

Commit

Permalink
Nuke a never-used easter egg.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceejbot committed Oct 19, 2022
1 parent c884aee commit 05a9483
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 163 deletions.
1 change: 1 addition & 0 deletions SEEDS
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ HAVE NO FEAR LOUDBOT IS HERE
HEY, YOU. YOU'RE FINALLY AWAKE. YOU WERE TRYING TO CROSS THE BORDER, RIGHT? WALKED RIGHT INTO THAT IMPERIAL AMBUSH, SAME AS US, AND THAT THIEF OVER THERE.
HUGE MISTAKE
I GOT TO THINKING… MAYBE I’M THE DRAGONBORN AND I JUST DON’T KNOW IT YET!
I JUST LIKE SERVALS, OKAY?
I KNOW I'VE MADE SOME VERY POOR DECISIONS RECENTLY, BUT I CAN GIVE YOU MY COMPLETE ASSURANCE THAT MY WORK WILL BE BACK TO NORMAL. I'VE STILL GOT THE GREATEST ENTHUSIASM AND CONFIDENCE IN THE MISSION.
I LIKE YOUR OPTIMISM
I USED TO BE AN ADVENTURER LIKE YOU, THEN I TOOK AN ARROW IN THE KNEE.
Expand Down
142 changes: 0 additions & 142 deletions WHALES

This file was deleted.

3 changes: 1 addition & 2 deletions src/bin/SEED.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(non_snake_case)]
//! SEED fills out redis with data for all the special features and then
//! adds shouts from files listed as arguments.
//! Example usage: `SEED SEEDS WHALES custom.txt`
//! Example usage: `SEED SEEDS custom.txt`
//! All seed files must be newline-delimited text files.
use anyhow::{Context, Result};
use dotenv::dotenv;
Expand Down Expand Up @@ -72,7 +72,6 @@ fn main() -> Result<()> {
seed_from_file(&mut rcon, "STAR_FIGHTING", &swkey, true)?;
seed_from_file(&mut rcon, "SHIPS", &shipkey, true)?;
seed_from_file(&mut rcon, "MALCOLM", &malckey, true)?;
seed_from_file(&mut rcon, "WHALES", &format!("{}:WHALES", redis_prefix), true)?;

for f in std::env::args().skip(1) {
seed_from_file(&mut rcon, &f, &yellkey, false)?;
Expand Down
19 changes: 0 additions & 19 deletions src/loudbot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ const SHIPS: &str = "LB:SHIPS";
const CATS: &str = "LB:CAT";
/// Redis key for a set of URLs for GIFs of Malcolm Tucker.
const MALCOLM: &str = "LB:MALC";
/// Redis key for set of Moby Dick chapter titles.
const WHALES: &str = "LB:WHALES";
/// Redis key for count of times yelled
const COUNT: &str = "LB:COUNT";

Expand Down Expand Up @@ -187,8 +185,6 @@ pub struct Classifier {
malc: Regex,
/// "Fuckity bye" gets a special from Malcolm Tucker.
fuckity: Regex,
/// The Moby Dick easter egg pattern.
whales: Regex,
}

impl Classifier {
Expand All @@ -203,7 +199,6 @@ impl Classifier {
ship: Regex::new(r"(?i)\bSHIP ?NAME\b").unwrap(),
ignore: Regex::new(IGNORE).unwrap(),
sw: Regex::new(SW).unwrap(),
whales: Regex::new(r"(?i)\bMOBY +DICK\b").unwrap(),
swears: regex::RegexSet::new(&[
r"(?i).*FUCK.*",
r"(?i)\bCUNT\b",
Expand All @@ -226,9 +221,6 @@ impl Classifier {
Retort::Random(CATS.to_string())
} else if self.ship.is_match(text) {
Retort::Random(SHIPS.to_string())
} else if self.whales.is_match(text) {
log::info!("moby dick triggered");
Retort::Random(WHALES.to_string())
} else if self.report.is_match(text) {
Retort::Report
} else if self.intro.is_match(text) {
Expand Down Expand Up @@ -303,17 +295,6 @@ mod tests {
assert!(patt.is_match("third moon of Endor"));
}

#[test]
fn whale_easter_egg() {
let detector = Classifier::new(0);

assert!(detector.whales.is_match("moby dick"));
assert!(detector.whales.is_match("herman melville wrote moby dick which is about whales and stuff"));
assert!(detector.whales.is_match("moby dick"));
assert!(detector.whales.is_match("MOBY DICK"));
assert!(!detector.whales.is_match("MOBY DICKLESS"));
}

#[test]
fn scunthorpe_problem() {
let detector = Classifier::new(100);
Expand Down

0 comments on commit 05a9483

Please sign in to comment.