2022-03-24 04:10:50 +00:00
|
|
|
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;
|
|
|
|
|
2022-03-24 04:28:51 +00:00
|
|
|
/**
|
|
|
|
* Main Listener
|
|
|
|
* Used for all utility garbage like guild handling and persistence. (Also LOL prevention).
|
|
|
|
*/
|
2022-03-24 04:10:50 +00:00
|
|
|
public class MainListener extends ListenerAdapter {
|
|
|
|
|
2022-03-24 04:28:51 +00:00
|
|
|
/**
|
|
|
|
* GuildJoin event listener, that ensures that a discord has a profile created for it.
|
|
|
|
* @param event - event to be handled...
|
|
|
|
*/
|
2022-03-24 04:10:50 +00:00
|
|
|
@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());
|
2022-03-26 05:04:24 +00:00
|
|
|
Kiafumi.instance.getServerManager().createNewDefaultServer(event.getGuild());
|
2022-03-24 04:10:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|