use of net.dv8tion.jda.api.events.channel.ChannelCreateEvent in project JDA by DV8FromTheWorld.
the class ChannelCreateHandler method handleInternally.
@Override
protected Long handleInternally(DataObject content) {
ChannelType type = ChannelType.fromId(content.getInt("type"));
long guildId = 0;
JDAImpl jda = getJDA();
if (type.isGuild()) {
guildId = content.getLong("guild_id");
if (jda.getGuildSetupController().isLocked(guildId))
return guildId;
}
Channel channel = buildChannel(type, content, guildId);
if (channel == null) {
WebSocketClient.LOG.debug("Discord provided an CREATE_CHANNEL event with an unknown channel type! JSON: {}", content);
return null;
}
jda.handleEvent(new ChannelCreateEvent(jda, responseNumber, channel));
return null;
}
use of net.dv8tion.jda.api.events.channel.ChannelCreateEvent in project JDA by DV8FromTheWorld.
the class ThreadCreateHandler method handleInternally.
@Override
protected Long handleInternally(DataObject content) {
long guildId = content.getLong("guild_id");
if (api.getGuildSetupController().isLocked(guildId))
return guildId;
ThreadChannel thread = api.getEntityBuilder().createThreadChannel(content, guildId);
api.handleEvent(new ChannelCreateEvent(api, responseNumber, thread));
return null;
}
Aggregations