Skip to content

Commit

Permalink
discord event meta: label the object type
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 3, 2022
1 parent 3b5d7be commit 36475a2
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public class DiscordButtonClickedScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.interaction> returns the interaction.
// <context.button> returns the button.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.interaction> returns the DiscordInteractionTag.
// <context.button> returns the DiscordButtonTag.
//
// -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class DiscordChannelCreateScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.channel> returns the new channel.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.channel> returns the new DiscordChannelTag.
// -->

public static DiscordChannelCreateScriptEvent instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class DiscordChannelDeleteScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.channel> returns the new channel.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.channel> returns the DiscordChannelTag.
// -->

public static DiscordChannelDeleteScriptEvent instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class DiscordMessageDeletedScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.old_message_valid> returns whether the old message is available (it may be lost due to caching).
// <context.old_message> returns the original DiscordMessageTag (data may be missing if not cached).
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public class DiscordMessageModifiedScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.new_message> returns the message as it now exists, as a DiscordMessageTag.
// <context.old_message_valid> returns whether the old message is available (it may be lost due to caching).
// <context.old_message> returns the original DiscordMessageTag (data may be missing if not cached).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class DiscordMessageReactionAddScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.message> returns the message.
// <context.user> returns the user that added the reaction.
// <context.reaction> returns the new reaction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public class DiscordMessageReactionRemoveScriptEvent extends DiscordScriptEvent
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.message> returns the message.
// <context.user> returns the user that removed the reaction.
// <context.reaction> returns the old reaction.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.message> returns the DiscordMessageTag.
// <context.user> returns the DiscordUserTag that removed the reaction.
// <context.reaction> returns the old DiscordReactionTag.
//
// -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ public class DiscordMessageReceivedScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.new_message> returns the message received, as a DiscordMessageTag.
//
// -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public class DiscordSelectionUsedScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.interaction> returns the interaction.
// <context.menu> returns the selection menu.
// <context.option> returns the selected option.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.interaction> returns the DiscordInteractionTag.
// <context.menu> returns the selection menu as a DiscordSelectionTag.
// <context.option> returns the selected option as a MapTag.
//
// -->

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public class DiscordSlashCommandScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.channel> returns the channel.
// <context.group> returns the group.
// <context.interaction> returns the interaction.
// <context.command> returns the command.
// <context.options> returns the supplied options.
// <context.bot> returns the relevant DiscordBotTag.
// <context.channel> returns the DiscordChannelTag.
// <context.group> returns the DiscordGroupTag.
// <context.interaction> returns the DiscordInteractionTag.
// <context.command> returns the DiscordCommandTag.
// <context.options> returns the supplied options as a MapTag.
//
// -->

Expand Down Expand Up @@ -85,7 +85,7 @@ public ObjectTag getContext(String name) {
case "command":
return new DiscordCommandTag(botID, getEvent().isFromGuild() ? getEvent().getGuild().getIdLong() : 0, getEvent().getCommandIdLong());
case "options": {
Map<StringHolder, ObjectTag> options = new HashMap<>();
MapTag options = new MapTag();
for (OptionMapping mapping : getEvent().getOptions()) {
ObjectTag result;
switch (mapping.getType()) {
Expand All @@ -110,9 +110,9 @@ public ObjectTag getContext(String name) {
case USER: result = new DiscordUserTag(botID, mapping.getAsUser()); break;
default: result = new ElementTag(botID, null);
}
options.put(new StringHolder(mapping.getName()), result);
options.putObject(mapping.getName(), result);
}
return new MapTag(options);
return options;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class DiscordThreadArchivedScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.thread> returns the thread channel.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.thread> returns the thread DiscordChannelTag.
// -->

public static DiscordThreadArchivedScriptEvent instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class DiscordThreadRevealedScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.thread> returns the thread channel.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.thread> returns the thread DiscordChannelTag.
// -->

public static DiscordThreadRevealedScriptEvent instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class DiscordUserJoinsScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.user> returns the user.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.user> returns the DiscordUserTag.
// -->

public static DiscordUserJoinsScriptEvent instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public class DiscordUserLeavesScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.user> returns the user.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.user> returns the DiscordUserTag.
// -->

public static DiscordUserLeavesScriptEvent instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class DiscordUserNicknameChangeScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.user> returns the user.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.user> returns the DiscordUserTag.
// <context.old_name> returns the user's previous nickname (if any).
// <context.new_name> returns the user's new nickname (if any).
// -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public class DiscordUserRoleChangeScriptEvent extends DiscordScriptEvent {
// @Group Discord
//
// @Context
// <context.bot> returns the relevant Discord bot object.
// <context.group> returns the group.
// <context.user> returns the user.
// <context.old_roles> returns a list of the user's previous role set.
// <context.new_roles> returns a list of the user's new role set.
// <context.added_roles> returns a list of the user's added role set.
// <context.removed_roles> returns a list of the user's removed role set.
// <context.bot> returns the relevant DiscordBotTag.
// <context.group> returns the DiscordGroupTag.
// <context.user> returns the DiscordUserTag.
// <context.old_roles> returns a ListTag of the user's previous DiscordRoleTag set.
// <context.new_roles> returns a ListTag of the user's new DiscordRoleTag set.
// <context.added_roles> returns a ListTag of the user's added DiscordRoleTag set.
// <context.removed_roles> returns a ListTag of the user's removed DiscordRoleTag set.
// -->

public static DiscordUserRoleChangeScriptEvent instance;
Expand Down

0 comments on commit 36475a2

Please sign in to comment.