Skip to content

auto scam detection + kick#46

Open
HacktheTime wants to merge 3 commits into
SkyHanniStudios:masterfrom
HacktheTime:master
Open

auto scam detection + kick#46
HacktheTime wants to merge 3 commits into
SkyHanniStudios:masterfrom
HacktheTime:master

Conversation

@HacktheTime

@HacktheTime HacktheTime commented Jun 29, 2026

Copy link
Copy Markdown

I had the idea of using ocr to auto detect and bankick users.

@HacktheTime HacktheTime changed the title auto scam detection + ban auto scam detection + kick Jul 1, 2026
@HacktheTime

Copy link
Copy Markdown
Author

@hannibal002

@hannibal002 hannibal002 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall interesting idea, but the broad design needs more thoughts ig

Comment thread src/main/kotlin/at/hannibal2/skyhanni/discord/DiscordBot.kt
event.message.delete().reason("Detected Scam. $foundScamWords").complete()
val embedBuilder = EmbedBuilder()
embedBuilder.setColor(Color.RED)
embedBuilder.setTitle("SkyHanni Server Kick")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of a kick, how about we just quarantine them via the new thingy?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk what you mean with that.

@HacktheTime HacktheTime Jul 3, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also quarantine means that things have to be handled by staff. kicking means if its a legit user they just can come back.


object AutoScamDetect {
fun ocrImageText(imageFile: File, lang: String = "eng"): String {
val tesseract = Tesseract()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a slow action, running on the bot main thread. this will slow down/delay all other events the bot wants to listen/deal with

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uh i didnt see any async code for this project? how should i integrate this?

embedBuilder.build()
)?.complete()
} catch (_: Throwable) {
//might have send another message before and got kicked already...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not eat errors

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect errors to be thrown due to Discord being asznc for us causing issues if a not sends 2 messages quickly. So I have to eat them no?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional problems could be if a user blocks the bot and so on. finding all possible errors is probably not worth it. if its fails well so it does. adding log for it maybe. but its probably irrelevant.

Comment thread src/main/kotlin/at/hannibal2/skyhanni/discord/command/AutoScamDetect.kt Outdated
Comment thread src/main/kotlin/at/hannibal2/skyhanni/discord/BotConfig.kt Outdated
Comment thread src/main/kotlin/at/hannibal2/skyhanni/discord/BotConfig.kt Outdated
Comment thread src/main/kotlin/at/hannibal2/skyhanni/discord/BotConfig.kt Outdated
Comment thread src/main/kotlin/at/hannibal2/skyhanni/discord/command/AutoScamDetect.kt Outdated
@HacktheTime

Copy link
Copy Markdown
Author

@hannibal002

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants