Skip to content
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

Some guild events #14

Merged
merged 1 commit into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.guild.update.GuildUpdateAfkChannelEvent;

public class GuildAFKChannelEvent extends DiSkyEvent<GuildUpdateAfkChannelEvent> {

static {
register("Guild AFK Channel Event", GuildAFKChannelEvent.class, BukkitGuildAFKChannelEvent.class,
"[discord] guild afk channel (change|update))")
.description("Fired when a afk channel of a guild changes \n can be used to get the old/new channel, the author and the guild.")
.examples("on guild afk channel change:");


SkriptUtils.registerBotValue(GuildAFKChannelEvent.BukkitGuildAFKChannelEvent.class);

SkriptUtils.registerAuthorValue(GuildAFKChannelEvent.BukkitGuildAFKChannelEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildAFKChannelEvent.BukkitGuildAFKChannelEvent.class, VoiceChannel.class,
event -> event.getJDAEvent().getOldValue(), -1);

SkriptUtils.registerValue(GuildAFKChannelEvent.BukkitGuildAFKChannelEvent.class, VoiceChannel.class,
event -> event.getJDAEvent().getNewValue(), 0);

SkriptUtils.registerValue(GuildAFKChannelEvent.BukkitGuildAFKChannelEvent.class, VoiceChannel.class,
event -> event.getJDAEvent().getNewValue(), 1);

SkriptUtils.registerValue(GuildAFKChannelEvent.BukkitGuildAFKChannelEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitGuildAFKChannelEvent extends SimpleDiSkyEvent<GuildUpdateAfkChannelEvent> {
public BukkitGuildAFKChannelEvent(GuildAFKChannelEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.guild.update.GuildUpdateAfkTimeoutEvent;

public class GuildAFKTimeoutEvent extends DiSkyEvent<GuildUpdateAfkTimeoutEvent> {

static {
register("Guild AFK Timeout Event", GuildAFKTimeoutEvent.class, BukkitAFKTimeoutEvent.class,
"[discord] guild afk timeout (change|update)")
.description("Fired when a afk timeout of a guild changes \n can be used to get the old/new timeout value, the author and the guild.")
.examples("on guild afk timeout change:");


SkriptUtils.registerBotValue(GuildAFKTimeoutEvent.BukkitAFKTimeoutEvent.class);

SkriptUtils.registerAuthorValue(GuildAFKTimeoutEvent.BukkitAFKTimeoutEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildAFKTimeoutEvent.BukkitAFKTimeoutEvent.class, Guild.Timeout.class,
event -> event.getJDAEvent().getOldValue(), -1);

SkriptUtils.registerValue(GuildAFKTimeoutEvent.BukkitAFKTimeoutEvent.class, Guild.Timeout.class,
event -> event.getJDAEvent().getNewValue(), 0);

SkriptUtils.registerValue(GuildAFKTimeoutEvent.BukkitAFKTimeoutEvent.class, Guild.Timeout.class,
event -> event.getJDAEvent().getNewValue(), 1);

SkriptUtils.registerValue(GuildAFKTimeoutEvent.BukkitAFKTimeoutEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitAFKTimeoutEvent extends SimpleDiSkyEvent<GuildUpdateAfkTimeoutEvent> {
public BukkitAFKTimeoutEvent(GuildAFKTimeoutEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.guild.update.GuildUpdateBannerEvent;

public class GuildBannerEvent extends DiSkyEvent<GuildUpdateBannerEvent> {

static {
register("Guild Banner Event", GuildBannerEvent.class, BukkitGuildBannerEvent.class,
"[discord] guild banner (change|update)")
.description("Fired when a banner of a guild changes \n can be used to get the old/new banner, the author and the guild.")
.examples("on guild banner change:");


SkriptUtils.registerBotValue(GuildBannerEvent.BukkitGuildBannerEvent.class);

SkriptUtils.registerAuthorValue(GuildBannerEvent.BukkitGuildBannerEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildBannerEvent.BukkitGuildBannerEvent.class, String.class,
event -> event.getJDAEvent().getOldBannerUrl(), -1);

SkriptUtils.registerValue(GuildBannerEvent.BukkitGuildBannerEvent.class, String.class,
event -> event.getJDAEvent().getNewBannerUrl(), 0);

SkriptUtils.registerValue(GuildBannerEvent.BukkitGuildBannerEvent.class, String.class,
event -> event.getJDAEvent().getNewBannerUrl(), 1);

SkriptUtils.registerValue(GuildBannerEvent.BukkitGuildBannerEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitGuildBannerEvent extends SimpleDiSkyEvent<GuildUpdateBannerEvent> {
public BukkitGuildBannerEvent(GuildBannerEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.guild.update.GuildUpdateIconEvent;

public class GuildIconEvent extends DiSkyEvent<GuildUpdateIconEvent> {

static {
register("Guild Icon Event", GuildIconEvent.class, BukkitGuildIconEvent.class,
"[discord] guild icon (change|update)")
.description("Fired when the icon of a guild changes \n can be used to get the old/new icon, the author and the guild.")
.examples("on guild icon change:");


SkriptUtils.registerBotValue(GuildIconEvent.BukkitGuildIconEvent.class);

SkriptUtils.registerAuthorValue(GuildIconEvent.BukkitGuildIconEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildIconEvent.BukkitGuildIconEvent.class, String.class,
event -> event.getJDAEvent().getOldIconUrl(), -1);

SkriptUtils.registerValue(GuildIconEvent.BukkitGuildIconEvent.class, String.class,
event -> event.getJDAEvent().getNewIconUrl(), 0);

SkriptUtils.registerValue(GuildIconEvent.BukkitGuildIconEvent.class, String.class,
event -> event.getJDAEvent().getNewIconUrl(), 1);

SkriptUtils.registerValue(GuildIconEvent.BukkitGuildIconEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitGuildIconEvent extends SimpleDiSkyEvent<GuildUpdateIconEvent> {
public BukkitGuildIconEvent(GuildIconEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;

public class GuildInviteCreateEvent extends DiSkyEvent<net.dv8tion.jda.api.events.guild.invite.GuildInviteCreateEvent> {

static {
register("Invite Create Event", GuildInviteCreateEvent.class, BukkitInviteCreateEvent.class,
"[discord] guild invite create)")
.description("Fired when a invite is created in a guild \n can be used to get the invite property, the author and the guild.")
.examples("guild invite create:");


SkriptUtils.registerBotValue(GuildInviteCreateEvent.BukkitInviteCreateEvent.class);

SkriptUtils.registerAuthorValue(GuildInviteCreateEvent.BukkitInviteCreateEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildInviteDeleteEvent.BukkitInviteDeleteEvent.class, Channel.class,
event -> event.getJDAEvent().getChannel(), 0);

SkriptUtils.registerValue(GuildInviteCreateEvent.BukkitInviteCreateEvent.class, Invite.class,
event -> event.getJDAEvent().getInvite(), 0);

SkriptUtils.registerValue(GuildInviteCreateEvent.BukkitInviteCreateEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitInviteCreateEvent extends SimpleDiSkyEvent<net.dv8tion.jda.api.events.guild.invite.GuildInviteCreateEvent> {
public BukkitInviteCreateEvent(GuildInviteCreateEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;

public class GuildInviteDeleteEvent extends DiSkyEvent<net.dv8tion.jda.api.events.guild.invite.GuildInviteDeleteEvent> {

static {
register("Invite Delete Event", GuildInviteDeleteEvent.class, BukkitInviteDeleteEvent.class,
"[discord] guild invite delete")
.description("Fired when a invite is deleted from a guild \n can be used to get the invite property, the author and the guild.")
.examples("guild invite create:");


SkriptUtils.registerBotValue(GuildInviteDeleteEvent.BukkitInviteDeleteEvent.class);

SkriptUtils.registerAuthorValue(GuildInviteDeleteEvent.BukkitInviteDeleteEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildInviteDeleteEvent.BukkitInviteDeleteEvent.class, Channel.class,
event -> event.getJDAEvent().getChannel(), 0);

SkriptUtils.registerValue(GuildInviteDeleteEvent.BukkitInviteDeleteEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitInviteDeleteEvent extends SimpleDiSkyEvent<net.dv8tion.jda.api.events.guild.invite.GuildInviteDeleteEvent> {
public BukkitInviteDeleteEvent(GuildInviteDeleteEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;

public class GuildJoinEvent extends DiSkyEvent<net.dv8tion.jda.api.events.guild.GuildJoinEvent> {

static {
register("Guild Join Event", GuildJoinEvent.class, BukkitGuildJoinEvent.class,
"[discord] bot join guild)")
.description("Fired when the bot joins in a guild.")
.examples("on bot join guild:");


SkriptUtils.registerBotValue(GuildJoinEvent.BukkitGuildJoinEvent.class);

SkriptUtils.registerValue(GuildJoinEvent.BukkitGuildJoinEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitGuildJoinEvent extends SimpleDiSkyEvent<net.dv8tion.jda.api.events.guild.GuildUnbanEvent> {
public BukkitGuildJoinEvent(GuildJoinEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.guild.update.GuildUpdateNameEvent;

public class GuildNameEvent extends DiSkyEvent<GuildUpdateNameEvent> {

static {
register("Guild Name Event", GuildNameEvent.class, BukkitGuildNameEvent.class,
"[discord] guild name (update|change))")
.description("Fired when the name of a guild is changed \n can be used to get the old/new name.")
.examples("on guild name:");


SkriptUtils.registerBotValue(GuildNameEvent.BukkitGuildNameEvent.class);

SkriptUtils.registerAuthorValue(GuildNameEvent.BukkitGuildNameEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildNameEvent.BukkitGuildNameEvent.class, String.class,
event -> event.getJDAEvent().getOldValue(), -1);

SkriptUtils.registerValue(GuildNameEvent.BukkitGuildNameEvent.class, String.class,
event -> event.getJDAEvent().getNewValue(), 0);

SkriptUtils.registerValue(GuildNameEvent.BukkitGuildNameEvent.class, String.class,
event -> event.getJDAEvent().getNewValue(), 1);

SkriptUtils.registerValue(GuildNameEvent.BukkitGuildNameEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitGuildNameEvent extends SimpleDiSkyEvent<GuildUpdateNameEvent> {
public BukkitGuildNameEvent(GuildNameEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.guild.update.GuildUpdateOwnerEvent;

public class GuildOwnerEvent extends DiSkyEvent<GuildUpdateOwnerEvent> {

static {
register("Guild Owner Event", GuildOwnerEvent.class, BukkitGuildOwnerEvent.class,
"[discord] guild owner (change|update)")
.description("Fired when a owner of a guild changes \n can be used to get the old/new owner, the author and the guild.")
.examples("on guild owner change:");


SkriptUtils.registerBotValue(GuildOwnerEvent.BukkitGuildOwnerEvent.class);

SkriptUtils.registerAuthorValue(GuildOwnerEvent.BukkitGuildOwnerEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildOwnerEvent.BukkitGuildOwnerEvent.class, Member.class,
event -> event.getJDAEvent().getOldOwner(), -1);

SkriptUtils.registerValue(GuildOwnerEvent.BukkitGuildOwnerEvent.class, Member.class,
event -> event.getJDAEvent().getNewOwner(), 0);

SkriptUtils.registerValue(GuildOwnerEvent.BukkitGuildOwnerEvent.class, Member.class,
event -> event.getJDAEvent().getNewOwner(), 1);

SkriptUtils.registerValue(GuildOwnerEvent.BukkitGuildOwnerEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild());

}

public static class BukkitGuildOwnerEvent extends SimpleDiSkyEvent<GuildUpdateOwnerEvent> {
public BukkitGuildOwnerEvent(GuildOwnerEvent event) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package info.itsthesky.disky.elements.events.guild;

import info.itsthesky.disky.api.events.DiSkyEvent;
import info.itsthesky.disky.api.events.SimpleDiSkyEvent;
import info.itsthesky.disky.core.SkriptUtils;
import net.dv8tion.jda.api.entities.*;
import net.dv8tion.jda.api.events.guild.update.GuildUpdateSplashEvent;

public class GuildSplashEvent extends DiSkyEvent<GuildUpdateSplashEvent> {

static {
register("Guild Splash Event", GuildSplashEvent.class, BukkitGuildSplashEvent.class,
"[discord] guild splash (change|update)")
.description("Fired when a banner of a guild changes \n can be used to get the old/new banner, the author and the guild.")
.examples("on guild splash change:");


SkriptUtils.registerBotValue(GuildSplashEvent.BukkitGuildSplashEvent.class);

SkriptUtils.registerAuthorValue(GuildSplashEvent.BukkitGuildSplashEvent.class, e -> e.getJDAEvent().getGuild());

SkriptUtils.registerValue(GuildSplashEvent.BukkitGuildSplashEvent.class, String.class,
event -> event.getJDAEvent().getOldSplashUrl(), -1);

SkriptUtils.registerValue(GuildSplashEvent.BukkitGuildSplashEvent.class, String.class,
event -> event.getJDAEvent().getNewSplashUrl(), 0);

SkriptUtils.registerValue(GuildSplashEvent.BukkitGuildSplashEvent.class, String.class,
event -> event.getJDAEvent().getNewSplashUrl(), 1);

SkriptUtils.registerValue(GuildSplashEvent.BukkitGuildSplashEvent.class, Guild.class,
event -> event.getJDAEvent().getGuild(), 0);

}

public static class BukkitGuildSplashEvent extends SimpleDiSkyEvent<GuildUpdateSplashEvent> {
public BukkitGuildSplashEvent(GuildSplashEvent event) {
}
}
}
Loading