Skip to content

Commit

Permalink
Update CountingListener.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
GustyCube authored Mar 30, 2024
1 parent 2785ea2 commit 397f6d2
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/main/kotlin/com/learnspigot/bot/counting/CountingListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ class CountingListener: ListenerAdapter() {
countingRegistry.fuckedUp(user)
}

fun addIdiotRole(user: User, guildId: String) {
val guild = user.jda.getGuildById(guildId) ?: return
val member = guild.getMemberById(user.id) ?: return
val role = guild.getRoleById("1162498330908180500") ?: return

if (!member.roles.contains(role)) {
guild.addRoleToMember(member, role).queue()
}
}


private fun Channel.isCounting() = id == Environment.get("COUNTING_CHANNEL_ID")
private fun Message.millisSinceLastCount() = timeCreated.toInstant().toEpochMilli() - (lastCount?.timeCreated?.toInstant()?.toEpochMilli() ?: 0)
Expand All @@ -57,7 +47,6 @@ class CountingListener: ListenerAdapter() {
event.message.addReaction(Server.downvoteEmoji)
event.message.reply("You can't count twice in a row, let someone else join in! ( The count has been reset to 1 )").queue()
fuckedUp(event.author)
addIdiotRole(event.author, event.guild.id)
}
val reactionEmoji = if (evaluated % 100 == 0) oneHundred else Server.upvoteEmoji

Expand Down

0 comments on commit 397f6d2

Please sign in to comment.