-
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
DiscordInviteCreateScriptEvent #59
base: master
Are you sure you want to change the base?
Conversation
|
@@ -81,6 +81,7 @@ public void onEnable() { | |||
ScriptEvent.registerScriptEvent(DiscordUserLeavesScriptEvent.class); | |||
ScriptEvent.registerScriptEvent(DiscordUserNicknameChangeScriptEvent.class); | |||
ScriptEvent.registerScriptEvent(DiscordUserRoleChangeScriptEvent.class); | |||
ScriptEvent.registerScriptEvent(DiscordInviteCreateScriptEvent.class); |
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 registration list is in alphabetical order (ie the order that your intellij file list should have them in anyway)
// <context.group> returns the DiscordGroupTag. | ||
// <context.channel> returns the DiscordChannelTag. | ||
// <context.user> returns the DiscordUserTag of the invitation creator. | ||
// <context.code> returns the ElementTag of the invitation code (after the "/" in the URL. |
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.
started a (
but didn't end it )
Also "the ElementTag of" is redundant
// <context.channel> returns the DiscordChannelTag. | ||
// <context.user> returns the DiscordUserTag of the invitation creator. | ||
// <context.code> returns the ElementTag of the invitation code (after the "/" in the URL. | ||
// <context.url> returns the ElementTag of the invitation URL |
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.
.
at end
src/main/java/com/denizenscript/ddiscordbot/events/DiscordInviteCreateScriptEvent.java
Show resolved
Hide resolved
case "user": | ||
return new DiscordUserTag(botID, getEvent().getInvite().getInviter()); | ||
case "code": | ||
return new ElementTag(getEvent().getInvite().getCode()); |
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.
, true
on the elementtag constructors
Updated |
// <context.group> returns the DiscordGroupTag. | ||
// <context.channel> returns the DiscordChannelTag. | ||
// <context.user> returns the DiscordUserTag of the invitation creator. | ||
// <context.code> returns the invitation code (after the latest "/" in the URL). |
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.
you meant last
not latest
// @Context | ||
// <context.bot> returns the relevant DiscordBotTag. | ||
// <context.group> returns the DiscordGroupTag. | ||
// <context.channel> returns the DiscordChannelTag. |
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.
I'd provide context here for at least the channel (and maybe also the group?), as it's not super clear what is it on first read - I assume the channel the invite leads to?
Otherwise LGTM
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 👍🏻
I should have asked earlier but I wasn't paying enough attention: How is this in any way relevant to dDiscordBot? What possible use could there be for monitoring invites from your minecraft server? |
On my server, I have implemented a referral system that rewards players who bring in other players. This event allows me to link created and used invitations to specific players and create new referrals. |
Adding a
DiscordInviteCreateScriptEvent
to allow the monitoring of created invitations