28 lines
972 B
Java
28 lines
972 B
Java
package moe.oko.Kiafumi.listener;
|
|
|
|
import moe.oko.Kiafumi.Kiafumi;
|
|
import net.dv8tion.jda.api.events.guild.GuildJoinEvent;
|
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
|
|
|
import static moe.oko.Kiafumi.Kiafumi.info;
|
|
|
|
/**
|
|
* Main Listener
|
|
* Used for all utility garbage like guild handling and persistence. (Also LOL prevention).
|
|
*/
|
|
public class MainListener extends ListenerAdapter {
|
|
|
|
/**
|
|
* GuildJoin event listener, that ensures that a discord has a profile created for it.
|
|
* @param event - event to be handled...
|
|
*/
|
|
@Override
|
|
public void onGuildJoin(GuildJoinEvent event) {
|
|
//Automatically create our default information for the server if we don't have it already.
|
|
info("Joined a new guild, NAME: " + event.getGuild().getName() + " ID: " + event.getGuild().getId());
|
|
Kiafumi.instance.getServerManager().createNewDefaultServer(event.getGuild());
|
|
Kiafumi.instance.registerForGuild(event.getGuild());
|
|
}
|
|
|
|
}
|