DiscordInviteCreateScriptEvent#59
Conversation
|
|
| ScriptEvent.registerScriptEvent(DiscordUserLeavesScriptEvent.class); | ||
| ScriptEvent.registerScriptEvent(DiscordUserNicknameChangeScriptEvent.class); | ||
| ScriptEvent.registerScriptEvent(DiscordUserRoleChangeScriptEvent.class); | ||
| ScriptEvent.registerScriptEvent(DiscordInviteCreateScriptEvent.class); |
There was a problem hiding this comment.
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.
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 |
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.
, 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). |
| // @Context | ||
| // <context.bot> returns the relevant DiscordBotTag. | ||
| // <context.group> returns the DiscordGroupTag. | ||
| // <context.channel> returns the DiscordChannelTag. |
There was a problem hiding this comment.
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
|
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
DiscordInviteCreateScriptEventto allow the monitoring of created invitations