Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawsson authored May 12, 2024
2 parents 810b929 + 6913522 commit b2cf22e
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 4 deletions.
110 changes: 110 additions & 0 deletions src/main/kotlin/com/learnspigot/bot/counting/CountingInsults.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
package com.learnspigot.bot.counting

object CountingInsults {
val fuckedUpInsults = listOf(
"Were you counting with your eyes closed?",
"Did you mistake numbers for alphabet letters?",
"Are you allergic to numbers or just incompetent?",
"Did you skip math class for skipping numbers?",
"Your counting skills are like a broken record - stuck on repeat.",
"Were you counting with your fingers in your ears?",
"Even a toddler could count better than that.",
"I've seen smoother counting from a malfunctioning calculator.",
"Did you confuse counting with alphabetizing?",
"Did you lose count because you ran out of fingers?",
"You must have a PhD in miscounting.",
"Were you using an abacus with missing beads?",
"Your counting skills are about as accurate as a blindfolded archer.",
"I've heard better counting from a parrot with a limited vocabulary.",
"Did you forget to engage your brain while counting?",
"Your counting proficiency rivals that of a distracted squirrel.",
"Did you fall asleep halfway through counting?",
"You're counting like you're trying to find your way through a maze blindfolded.",
"I didn't know counting could be performed with such remarkable ineptitude.",
"I've seen smoother counting from a broken clock.",
"Were you distracted by counting sheep instead of numbers?",
"Did you skip numbers like a stone on a pond?",
"Your counting abilities are as shaky as a Jenga tower in an earthquake.",
"Did you misplace your counting skills along with your common sense?",
"Even a GPS would have trouble navigating your counting route.",
"You're counting like you're allergic to reaching the correct number.",
"Your counting skills are like a GPS without satellite reception - hopelessly lost.",
"Did you confuse counting with a game of hopscotch?",
"You're counting like you're trying to break a world record for most mistakes in a minute.",
"Did you mistakenly count your own mistakes?",
"Your counting proficiency is comparable to a toddler on roller skates - all over the place.",
"Did you accidentally count backwards instead of forwards?",
"Your counting skills are like a Picasso painting - abstract and confusing.",
"Did you mistake counting for a memory test?",
"You're counting like you're trying to decipher hieroglyphics.",
"Did you misplace your counting marbles?",
"Your counting abilities are as reliable as a fortune told by a Magic 8-Ball.",
"Were you trying to count while riding a roller coaster?",
"You're counting like you're trying to break the sound barrier - fast but completely out of control.",
"Did you confuse counting with a game of roulette?",
"Your counting skills are like a GPS without batteries - going absolutely nowhere.",
"Were you trying to count while juggling flaming torches?",
"Did you accidentally count in a foreign language?",
"Your counting abilities are as consistent as the weather in spring - all over the place.",
"Did you mistake counting for a game of Whac-A-Mole?",
"You're counting like you're trying to solve a Rubik's Cube blindfolded.",
"Did you forget how to count and decide to guess instead?",
"Your counting skills are like a broken compass - pointing in every direction except the right one.",
"Were you trying to count while riding a unicycle on a tightrope?",
"Did you mistakenly count imaginary friends instead of numbers?"
)

val doubleCountInsults = listOf(
"Did you forget you already counted that?",
"Are you hoping the numbers will change if you count them again?",
"You must really love that number to count it twice.",
"Did you hit the replay button on your counting?",
"Is double counting your secret strategy for getting the right answer?",
"I didn't realize we were playing a counting remix.",
"Did you accidentally press the repeat button on your counting machine?",
"I guess counting once just wasn't enough for you.",
"You're like a broken record, but with numbers.",
"Are you trying to see if the numbers change their minds?",
"Your counting is like déjà vu - I feel like I've heard it before.",
"Are you practicing for the counting Olympics by doing extra laps?",
"Did you think we wouldn't notice if you counted it again?",
"I've heard of double trouble, but this is ridiculous.",
"Did you get lost on the way back to the first number?",
"You're like a dog chasing its tail, but with numbers.",
"Did you accidentally hit the rewind button on your counting?",
"Congratulations, you just doubled your counting effort for no reason.",
"You're like a broken clock, but instead of being right twice a day, you're just counting twice.",
"Is this your way of making sure the numbers didn't disappear while you weren't looking?",
"I didn't realize we were in a counting loop.",
"Did you think the numbers were playing hide and seek?",
"Is this your version of counting insurance - counting it twice just in case?",
"You're like a magician pulling the same rabbit out of the hat twice.",
"Did you accidentally hit the repeat button on your counting playlist?",
"Your counting is like a bad sequel - nobody asked for it.",
"Did you think the numbers would change their minds if you asked them nicely?",
"You're like a detective solving the case of the missing numbers by counting them twice.",
"Did you think the numbers were playing a disappearing act?",
"I guess you just wanted to give the numbers a second chance to be counted.",
"Is this your way of ensuring job security for counters everywhere?",
"Your counting is like Groundhog Day - the same numbers over and over again.",
"Did you accidentally press the refresh button on your counting app?",
"You're like a broken vending machine - you keep giving out the same numbers.",
"Did you think the numbers were playing hide and seek with you?",
"Your counting is like a rerun of a bad TV show - nobody wants to see it twice.",
"Did you think the numbers were going to disappear if you didn't count them again?",
"You're like a child asking 'are we there yet?' but with numbers.",
"Did you think the numbers were going to change their minds if you counted them twice?",
"Your counting is like a bad sequel - nobody asked for it.",
"Did you think the numbers were playing a disappearing act?",
"I guess you just wanted to give the numbers a second chance to be counted.",
"Is this your way of ensuring job security for counters everywhere?",
"Your counting is like Groundhog Day - the same numbers over and over again.",
"Did you accidentally press the refresh button on your counting app?",
"You're like a broken vending machine - you keep giving out the same numbers.",
"Did you think the numbers were playing hide and seek with you?",
"Your counting is like a rerun of a bad TV show - nobody wants to see it twice.",
"Did you think the numbers were going to disappear if you didn't count them again?",
"You're like a child asking 'are we there yet?' but with numbers.",
"Did you think the numbers were going to change their minds if you counted them twice?"
)
}
20 changes: 17 additions & 3 deletions src/main/kotlin/com/learnspigot/bot/counting/CountingListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import net.dv8tion.jda.api.events.message.MessageDeleteEvent
import net.dv8tion.jda.api.events.message.MessageReceivedEvent
import net.dv8tion.jda.api.events.message.MessageUpdateEvent
import net.dv8tion.jda.api.hooks.ListenerAdapter
import net.dv8tion.jda.api.entities.Member

class CountingListener: ListenerAdapter() {

Expand All @@ -26,10 +27,12 @@ class CountingListener: ListenerAdapter() {
countingRegistry.fuckedUp(user)
}


private fun Channel.isCounting() = id == Environment.get("COUNTING_CHANNEL_ID")
private fun Message.millisSinceLastCount() = timeCreated.toInstant().toEpochMilli() - (lastCount?.timeCreated?.toInstant()?.toEpochMilli() ?: 0)

private val thinking = Emoji.fromUnicode("🤔")
private val oneHundred = Emoji.fromUnicode("💯")

override fun onMessageReceived(event: MessageReceivedEvent) {
if (event.author.isBot || !event.isFromGuild || !event.channel.isCounting() || event.guild.id != Server.guildId) return
Expand All @@ -42,12 +45,20 @@ class CountingListener: ListenerAdapter() {
if (evaluated == currentCount + 1) {
if (userId.equals(lastCount?.author?.id, true)) return run {
event.message.addReaction(Server.downvoteEmoji)
event.message.reply("${lastCount?.author?.asMention}, You can't count twice in a row, let someone else join in! ( The count has been reset to 1 )").queue()

val insultMessage = CountingInsults.doubleCountInsults.random()

event.message.reply("$insultMessage The count has been reset to 1.").queue()

fuckedUp(event.author)
}
val reactionEmoji = if (evaluated % 100 == 0) oneHundred else Server.upvoteEmoji


lastCount = event.message
event.message.addReaction(Server.upvoteEmoji).queue()
event.message.addReaction(reactionEmoji).queue()
countingRegistry.incrementCount(event.author)

} else {
if (evaluated == currentCount && event.message.millisSinceLastCount() < 600) {
// ( 600ms delay ) - Arbitrary value based on superficial testing
Expand All @@ -58,7 +69,10 @@ class CountingListener: ListenerAdapter() {
val next = currentCount + 1
fuckedUp(event.author)
event.message.addReaction(Server.downvoteEmoji).queue()
event.message.reply("${lastCount?.author?.asMention}, The next number was $next, not $evaluated").queue()

val insultMessage = CountingInsults.fuckedUpInsults.random()

event.message.reply("$insultMessage ${lastCount?.author?.asMention}, The next number was $next, not $evaluated.").queue()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ class ShowcaseListener : ListenerAdapter() {
if (event.channel.id != Environment.get("SHOWCASE_CHANNEL_ID")) return

event.message.addReaction(Emoji.fromUnicode("❤️")).queue()
event.message.createThreadChannel("Showcase from ${event.message.author.globalName}").queue()
event.message.createThreadChannel("Showcase from ${event.author.effectiveName}").queue()
}
}

0 comments on commit b2cf22e

Please sign in to comment.