-
Notifications
You must be signed in to change notification settings - Fork 13
/
DiscordUserLeavesScriptEvent.java
39 lines (33 loc) · 1.22 KB
/
DiscordUserLeavesScriptEvent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.denizenscript.ddiscordbot.events;
import com.denizenscript.ddiscordbot.DiscordScriptEvent;
import net.aufdemrand.denizencore.scripts.containers.ScriptContainer;
import net.aufdemrand.denizencore.utilities.CoreUtilities;
public class DiscordUserLeavesScriptEvent extends DiscordScriptEvent {
public static DiscordUserLeavesScriptEvent instance;
// <--[event]
// @Events
// discord user leaves (for <bot>)
//
// @Regex ^on discord user leaves( for [^\s]+)?$
//
// @Triggers when a Discord user leaves a guild.
//
// @Plugin dDiscordBot
//
// @Context
// <context.bot> returns the Denizen ID of the bot.
// <context.group> returns the group ID.
// <context.group_name> returns the group name.
// <context.user_id> returns the user's internal ID.
// <context.user_name> returns the user's name.
// <context.self> returns the bots own Discord user ID.
// -->
@Override
public boolean couldMatch(ScriptContainer scriptContainer, String s) {
return CoreUtilities.toLowerCase(s).startsWith("discord user leaves");
}
@Override
public String getName() {
return "DiscordLeaveUser";
}
}