Conversation
| // @description | ||
| // Returns a boolean indicating whether the user is boosting the specified group or not. | ||
| // --> | ||
| tagProcessor.registerTag(ElementTag.class, "is_boosting", (attribute, object) -> { |
There was a problem hiding this comment.
could register with the required discordgrouptag input, see <DiscordUserTag.is_in_group[<group>]> for example
|
Same question as the other PR, how is this in any way relevant for dDiscordBot? |
|
With a system that links Minecraft accounts to Discord accounts, I give a reward, such as a badge, to all guild boosters. Additionally, when the guild levels up or down, an in-game message is sent to everyone to thank them for their support. |
| // | ||
| // @Context | ||
| // <context.bot> returns the relevant DiscordBotTag. | ||
| // <context.group> returns the DiscordGroupTag. |
There was a problem hiding this comment.
What group? ideally any meta entry should make it immediately clear upon first read (so whose boost count changed or something along those lines)
| // <context.new_count> returns the new amount of boosts of the group. | ||
| // <context.old_count> returns the old amount of boosts of the group. |
There was a problem hiding this comment.
Maybe the group's new/old amount of boosts?
src/main/java/com/denizenscript/ddiscordbot/events/DiscordUpdateBoostCountEvent.java
Show resolved
Hide resolved
| ListTag list = new ListTag(); | ||
| for (Member member : object.getGuild().getBoosters()) { | ||
| list.addObject(new DiscordUserTag(object.bot, member.getUser())); | ||
| } | ||
| return list; |
There was a problem hiding this comment.
Can use the ListTag convertor constructor
| // @returns ListTag(DiscordUserTag) | ||
| // @plugin dDiscordBot | ||
| // @description | ||
| // Returns a list of all users in the group that currently boosts the group. |
| // @returns ElementTag(Number) | ||
| // @plugin dDiscordBot | ||
| // @description | ||
| // Returns the tier of the group currently set by its boosts. |
There was a problem hiding this comment.
Maybe just Returns the group's current boost tier, see <@link> for all possible tiers.?
| }); | ||
|
|
||
| // <--[tag] | ||
| // @attribute <DiscordGroupTag.tier> |
There was a problem hiding this comment.
Might be better to name it boost_tier, would match with boosts_count as well.
| // Returns a boolean indicating whether the user is boosting the specified group or not. | ||
| // --> | ||
| tagProcessor.registerTag(ElementTag.class, DiscordGroupTag.class, "is_boosting", (attribute, object, group) -> { | ||
| if (object.getUser() == null) { |
There was a problem hiding this comment.
Should use #getUserForTag here, like the other tags
| // @returns ElementTag(Boolean) | ||
| // @plugin dDiscordBot | ||
| // @description | ||
| // Returns a boolean indicating whether the user is boosting the specified group or not. |
There was a problem hiding this comment.
No need to specify a boolean, can just Returns whether X
| }); | ||
|
|
||
| // <--[tag] | ||
| // @attribute <DiscordUserTag.is_boosting[<group>]> |
There was a problem hiding this comment.
doesn't discord add an unremovable role for this
There was a problem hiding this comment.
ie most of these tags and the event can be replaced by just scripts checking the role
There was a problem hiding this comment.
The role can be renamed, this tag comes as an reliable alternative mean without using a RoleTag based input.
Adding 4 tags and 1 new event to support discord boosts integration.
New Tags
DiscordUserTag.is_boosting[<group>]DiscordGroupTag.boostersDiscordGroupTag.boost_tierDiscordGroupTag.boosts_countNew Events
discord boosts count changesUpdating the java docs link to the new one.