brackeys-bot icon indicating copy to clipboard operation
brackeys-bot copied to clipboard

[FEATURE] Non-formated code detection

Open Wokarol opened this issue 5 years ago • 8 comments

Why do you want this feature? What is the problem? Massive codeblocks without proper tags "```" are not detected and take a lot of space

Describe the solution you'd like Bot should detect if message is long and contains keywords like " : MonoBehaviour" or "public void". it should be then flagged and message should appear with option to paste it or not. This decision should be handed to Gurus as they take partial care of development channels. Feature should be exclusive to development channels.

Wokarol avatar Mar 15 '20 21:03 Wokarol

Talking about code schemes will trigger the bot then? I see this as potentially making more mess because the bot will create messages for fake triggers.

AquaXV avatar Mar 15 '20 21:03 AquaXV

Good point, but we can create simple regex for simple syntax detection and when talking about code schemes we usually use code blocks

Wokarol avatar Mar 15 '20 21:03 Wokarol

You do, new people don't. It needs to be userfriendly. And there is no "simple regex" for code detection. Code is complex in terms detection without using a parser for the language because changing language can result in different syntax and thus requiring a different regex/parser.

AquaXV avatar Mar 15 '20 21:03 AquaXV

By simple syntax detection I mean something like "((private)|(public)).*(: MonoBehaviour).*{.*}"

Wokarol avatar Mar 15 '20 21:03 Wokarol

So if I start talking about making methods private in my class this sentence {may/is already} flag(ged)?

AquaXV avatar Mar 15 '20 21:03 AquaXV

From my experience, code involving ": MonoBehaviour" and "{ }" in almost all (if not all) cases is in codeblock or inline "codeblock" (the one with singular `

Wokarol avatar Mar 18 '20 22:03 Wokarol

So just to recap - when unformatted code is detected, the bot should prompt an option for a guru to paste it? @Wokarol

yiliansource avatar Mar 25 '20 17:03 yiliansource

Yes

Wokarol avatar Mar 25 '20 17:03 Wokarol