use of com.denizenscript.ddiscordbot.objects.DiscordGroupTag in project dDiscordBot by DenizenScript.
the class DiscordMessageModifiedScriptEvent method getContext.
@Override
public ObjectTag getContext(String name) {
switch(name) {
case "channel":
return new DiscordChannelTag(botID, getEvent().getChannel());
case "group":
if (getEvent().isFromGuild()) {
return new DiscordGroupTag(botID, getEvent().getGuild());
}
break;
case "new_message":
return new DiscordMessageTag(botID, getEvent().getMessage());
case "old_message_valid":
return new ElementTag(oldMessage != null);
case "old_message":
return oldMessage == null ? null : new DiscordMessageTag(botID, oldMessage);
case "old_no_mention_message":
case "old_formatted_message":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return null;
case "message":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getMessage().getContentRaw());
case "message_id":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getMessage().getId());
case "no_mention_message":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(DiscordMessageTag.stripMentions(getEvent().getMessage().getContentRaw()));
case "formatted_message":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getMessage().getContentDisplay());
case "author":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new DiscordUserTag(botID, getEvent().getMessage().getAuthor());
case "mentions":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
ListTag list = new ListTag();
for (User user : getEvent().getMessage().getMentionedUsers()) {
list.addObject(new DiscordUserTag(botID, user));
}
return list;
case "is_direct":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getChannel() instanceof PrivateChannel);
}
return super.getContext(name);
}
use of com.denizenscript.ddiscordbot.objects.DiscordGroupTag in project dDiscordBot by DenizenScript.
the class DiscordMessageReceivedScriptEvent method getContext.
@Override
public ObjectTag getContext(String name) {
switch(name) {
case "channel":
return new DiscordChannelTag(botID, getEvent().getChannel());
case "group":
if (getEvent().isFromGuild()) {
return new DiscordGroupTag(botID, getEvent().getGuild());
}
break;
case "new_message":
return new DiscordMessageTag(botID, getEvent().getMessage());
case "message":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getMessage().getContentRaw());
case "message_id":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getMessage().getId());
case "no_mention_message":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(DiscordMessageTag.stripMentions(getEvent().getMessage().getContentRaw()));
case "formatted_message":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getMessage().getContentDisplay());
case "author":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new DiscordUserTag(botID, getEvent().getMessage().getAuthor());
case "mentions":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
ListTag list = new ListTag();
for (User user : getEvent().getMessage().getMentionedUsers()) {
list.addObject(new DiscordUserTag(botID, user));
}
return list;
case "is_direct":
DenizenDiscordBot.oldMessageContexts.warn((TagContext) null);
return new ElementTag(getEvent().getChannel() instanceof PrivateChannel);
}
return super.getContext(name);
}
Aggregations