Quotes board: Allow reactions with any emoji#1389
Quotes board: Allow reactions with any emoji#1389christolis wants to merge 2 commits intoTogether-Java:developfrom
Conversation
Recently from the server suggestions, many people have been slightly upset
that the only reaction emoji considered for adding to the quotes board is
the default star emoji.
Some members have suggested specific additional emojis to be considered,
others suggested that the star emoji should have a weight of 1.0 while
the rest of the emojis should have a weight of 0.5. While both solutions
can work, all emojis can have a custom weight for the purpose of
customizability.
Introduce a scoring concept for each emoji, configurable for each
particular one, and provide the ability to set a default value if an emoji
is not defined in the configuration file.
For those who are wondering, _any_ kind of emoji that Discord can handle
is able to be added in the configuration, including custom emojis in the
server. JDA can keep track of those.
For adding a unicode emoji, the actual unicode value has to be provided,
like it has been done in "config.json.template".
For adding a guild emoji, a "code" for the emoji has to be provided, for
instance:
youtube:1464573182206804010
Which stands for the friendly name of the emoji, a colon right after, and
finally the ID of the custom emoji.
The "config.json.template" is _NOT_ exhaustive, more emojis have to be
added and some others removed according to preference.
Signed-off-by: Chris Sdogkos <work@chris-sdogkos.com>
| "🇷🇺": 0.0, | ||
| "🇵🇸": 0.0, | ||
| "🇮🇱": 0.0, | ||
| "🏳️🌈": 0.0, |
There was a problem hiding this comment.
I don't think we should keep this politically influenced example in the repo.
There was a problem hiding this comment.
As discussed in Discord, it's an example, it's made to prove a point for the person setting the configuration, to give them an idea on how to provide scores for each emoji. It's intentionally there to evoke an emotion, and all of these flags have a flag of 0 to maintain neutrality. No flag is more powerful than the other, at least none of the flags commonly used as reactions to offend in 2026.
There was a problem hiding this comment.
My tip: Avoid flag reactions
firasrg
left a comment
There was a problem hiding this comment.
@christolis Thank you for this update, please check my reviews, thank you
| }, | ||
| "quoteBoardConfig": { | ||
| "minimumReactionsToTrigger": 5, | ||
| "minimumScoreToTrigger": 5.0, |
There was a problem hiding this comment.
There is no need to put it decimal
There was a problem hiding this comment.
@firasrg Just curious: what happens if we want half-point scoring later (like the 0.5 for non-star emojis)?
| @@ -195,9 +195,34 @@ | |||
| "pollIntervalInMinutes": 10 | |||
| }, | |||
| "quoteBoardConfig": { | |||
There was a problem hiding this comment.
I think that we should ignore some text channels like announcements, and hall-of-fame, github-activity-logs, vps-status, bots and the likes, because they are not intended for such a feature, consider to put a config attribute to list them here
|
|
||
| "⭐": 1.0, | ||
|
|
||
| "youtube:1464573182206804010": 0.0 |
There was a problem hiding this comment.
While I know this is an example, it's better to add a custom emoji ID from the server TJ for more consistency
| .queue(message -> markAsProcessed(message).flatMap(v -> message.forwardTo(boardChannel)) | ||
| .queue(_ -> logger.debug("Message forwarded to quote board channel: {}", | ||
| boardChannel.getName())), | ||
| if (emojiScore < config.minimumScoreToTrigger()) { |
Problem
Recently from the server suggestions, many people have been slightly upset that the only reaction emoji considered for adding to the quotes board is the default star emoji.
Some members have suggested specific additional emojis to be considered, others suggested that the star emoji should have a weight of
1.0while the rest of the emojis should have a weight of0.5. While both solutions can work, all emojis can have a custom weight for the purpose of customizability.Solution
Introduce a scoring concept for each emoji, configurable for each particular one, and provide the ability to set a default value if an emoji is not defined in the configuration file.
For those who are wondering, any kind of emoji that Discord can handle is able to be added in the configuration, including custom emojis in the server. JDA can keep track of those.
For adding a unicode emoji, the actual unicode value has to be provided, like it has been done in
config.json.template.For adding a guild emoji, a "code" for the emoji has to be provided, for instance:
Which stands for the friendly name of the emoji, a colon right after, and finally the ID of the custom emoji.
The "config.json.template" is NOT exhaustive, more emojis have to be added and some others removed according to preference.
Configuration changes
quoteBoardConfig
quoteBoardConfig.minimumScoreToTrigger5.0quoteBoardConfig.channel"quotes"quoteBoardConfig.botEmoji⭐quoteBoardConfig.defaultEmojiScore0.5quoteBoardConfig.emojiScoresemojiScores Map
{ "😬": -0.5, "💔": -0.5, "🖕": -0.5, "👎": -0.5, "🤨": -0.5, "🇷🇺": 0.0, "🇵🇸": 0.0, "🇮🇱": 0.0, "⭐": 1.0, /* Custom emoji */ "youtube:1464573182206804010": 0.0 }