Obi-Wan3 / OB13-Cogs

Utility Cogs for Red by Obi-Wan3
https://github.com/Obi-Wan3/OB13-Cogs
MIT License
18 stars 38 forks source link

[Translate] Message Translation #5

Closed JKohlman closed 3 years ago

JKohlman commented 3 years ago

Instead of having to copy/paste a message it would be very nice to specify a message to translate. I saw your plan of potential reaction-based translations and I think that would be a good idea but until that is complete there's not a great solution so I figured I'd make a solution in the meantime.

This code very simply adds a secondary syntax to [p]translate - if the message parameter passed is a valid message ID from the same channel then it changes the target of the translation to the contents of the referenced message.

Example:

  1. I send the message this is a test message and that message has ID 1234.
  2. I send the command [p]translate French 1234.
  3. Bot replies with the translation of this is a test message -> Ceci est un message test

In the event of an error at any step this falls back on the default behavior.

I wasn't sure whether to do this like I did or whether a subcommand would be more appropriate. I'd love to hear feedback so I can adjust and prep for review/merging.

Obi-Wan3 commented 3 years ago

Hey @JKohlman, thanks for this feature request. While I do believe that the request is a good and valid addition to Translate, I will be closing this as I ask potential contributors to discuss anything with me on Discord first before a PR (see the Contributing section of README.md), and for something new like this it would be preferred for an issue to be opened first and foremost. In the future, please be sure to do the above, and feel free to contact me on Discord if you have any questions. For this message idea, I have considered it before but did not have much need for it myself, but I will be implementing this as another command (along with more possible improvements) once my fixes on dev have been confirmed and pushed to main.

Obi-Wan3 commented 3 years ago

This has been added in 0617313f2c3d4e64d9273931d1899c0d9fba3429