danparizher / Pax-Academia

General purpose utility bot for the Homework Help Discord server
MIT License
13 stars 5 forks source link

Redesign Code Detection System for Improved Accuracy and Performance #216

Closed danparizher closed 1 year ago

danparizher commented 1 year ago

Discussion here: https://discord.com/channels/238956364729155585/1040360228388098159/1138249299847827498

Key insights:

Sometimes, people ask questions & don't format their code: image

This PR implements a system to automatically detect and format people's code for them: image

GabeMillikan commented 1 year ago

Quick preview for channel permissions:

https://github.com/Arborym/Pax-Academia/assets/44247924/82b18237-3d08-4989-92b8-a26421a79b3f

UNFORMATTED_CODE_DETECTION_CATEGORY_ID=<computer science help category id>
AUTO_FORMAT_CODE_CHANNEL_IDS=<python channel id>
sebastiaan-daniels commented 1 year ago

I have a feeling this would best be ephemeral. If people send very long messages the bot would respond with a message just as long, which might clutter the chat.

GabeMillikan commented 1 year ago

I have a feeling this would best be ephemeral. If people send very long messages the bot would respond with a message just as long, which might clutter the chat.

I think you're right about it probably cluttering chat, but I'm tempted to think that people still won't bother formatting their code. This message actually serves a purpose in allowing helpers to actually read the code as originally written.

Also, I don't think it's possible to send an ephemeral message if the user doesn't use a slash command

sebastiaan-daniels commented 1 year ago

I have a feeling this would best be ephemeral. If people send very long messages the bot would respond with a message just as long, which might clutter the chat.

I think you're right about it probably cluttering chat, but I'm tempted to think that people still won't bother formatting their code. This message actually serves a purpose in allowing helpers to actually read the code as originally written.

Also, I don't think it's possible to send an ephemeral message if the user doesn't use a slash command

Alrighty! We can definitely implement it like this then and change it in case of complaints. I thought it was possible to respond ephemerally even in on_message. I think I saw it before with some bot?

Also please undo the renaming of staffapps. Front-end and backend are technical terms. Both files are technically both front and backend. You could rename it to staffapps-user and staffapps-staff instead or keep the original.

sebastiaan-daniels commented 1 year ago

Not me completely messing up in githubs GUI :monkas:

sebastiaan-daniels commented 1 year ago

We should probably decorate this command as experimental as well once released in order to get some feedback before we start deleting messages.