unixporn / trup

Discord bot for the Unixporn community
Mozilla Public License 2.0
47 stars 9 forks source link

Editing & Undoing for warns and notes #58

Open elkowar opened 4 years ago

elkowar commented 4 years ago

The warn and note commands should have a !note undo <user> / !warn undo <user> command to remove the latest warn / note.

mlvzk commented 4 years ago

Instead of !note undo I think it would be better to do !note undo . For this we would need !note to show notes together with their IDs, but the IDs are pretty long so we should just show the last 3 or 4 characters and use that in !note undo

elkowar commented 4 years ago

we could also just make them indices, show the numbers and then do !note remove <note-nr> (that number just being an index). would not be quite as easy to implement (idk is there a way to do "delete the nth element in chronological order" in sql?), but would be a much better UX and lessen the theoretical possibility of a wrong deletion

mlvzk commented 4 years ago

Yes, that would be better. You could sort oldest to newest, skip \<note-nr>, limit 1 and delete that

elkowar commented 4 years ago

sounds good!

davidv171 commented 4 years ago

Should people see undone notes for a user? Maybe use strikethrough when creating a replied messages based on an "isActive" field? Instead of just completely wiping from the database.

elkowar commented 4 years ago

I don’t think that’s necessarily a good idea, as I would say the main intent behind an undo is being able to undo things like spelling errors, bad note descriptions, accidentally tagging the wrong user, etc. A note or warn that has been given for a good reason should never be removed at all. If the person apologises or whatever, we can add another note saying that, but I’d not want to remove it there,

elkowar commented 4 years ago

Of course this is just my understanding of the purpose here, if others Have different ideas I’m open of course