-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boosts Events and Tags #60
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could register with the required discordgrouptag input, see <DiscordUserTag.is_in_group[<group>]>
for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 😊 Thank you
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that currently boost it.
// @returns ElementTag(Number) | ||
// @plugin dDiscordBot | ||
// @description | ||
// Returns the tier of the group currently set by its boosts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to specify a boolean
, can just Returns whether X
@@ -240,6 +240,21 @@ public static void register() { | |||
return new ElementTag(object.getUser().isBot()); | |||
}); | |||
|
|||
// <--[tag] | |||
// @attribute <DiscordUserTag.is_boosting[<group>]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't discord add an unremovable role for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ie most of these tags and the event can be replaced by just scripts checking the role
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.boosters
DiscordGroupTag.boost_tier
DiscordGroupTag.boosts_count
New Events
discord boosts count changes
Updating the java docs link to the new one.