public class WauzDiscordBot
extends net.dv8tion.jda.api.hooks.ListenerAdapter
Modifier and Type | Field and Description |
---|---|
private net.dv8tion.jda.api.entities.TextChannel |
generalChannel
The general channel for the chat.
|
private boolean |
isRunning
If the bot is still running.
|
private net.dv8tion.jda.api.JDA |
jda
The API to access Discord from the bot account.
|
private net.dv8tion.jda.api.entities.TextChannel |
loggingChannel
The logging channel for the server log.
|
private static java.lang.String |
SKIN_API
The api to grab player skins.
|
Constructor and Description |
---|
WauzDiscordBot()
Creates and logs in a new bot and loads all channels.
|
Modifier and Type | Method and Description |
---|---|
void |
onMessageReceived(net.dv8tion.jda.api.events.message.MessageReceivedEvent event)
Reads a message from Discord and checks if it is a command.
|
static void |
sendEmbed(org.bukkit.entity.Player player,
java.lang.String title,
java.lang.String description,
java.awt.Color color,
net.dv8tion.jda.api.entities.TextChannel textChannel)
Sends an embed with custom title and color.
|
void |
sendEmbedFromMinecraft(org.bukkit.entity.Player player,
java.lang.String title,
java.lang.String description,
java.awt.Color color,
boolean inLogChannel)
Sends an embed with custom title and color.
|
void |
sendMessageFromMinecraft(java.lang.String message,
boolean inLogChannel)
Sends a message that will not be written into the Minecraft chat.
|
void |
stop()
Sets the bot user's status to offline and stops the bot.
|
void |
updateGeneralChannelServerStats()
Updates the topic of the general channel, to display the newest public stats.
|
void |
updateLoggingChannelServerStats()
Updates the topic of the logging channel, to display the newest private stats.
|
onCategoryCreate, onCategoryDelete, onCategoryUpdateName, onCategoryUpdatePermissions, onCategoryUpdatePosition, onDisconnect, onEmoteAdded, onEmoteRemoved, onEmoteUpdateName, onEmoteUpdateRoles, onEvent, onException, onGatewayPing, onGenericCategory, onGenericCategoryUpdate, onGenericEmote, onGenericEmoteUpdate, onGenericEvent, onGenericGuild, onGenericGuildInvite, onGenericGuildMember, onGenericGuildMemberUpdate, onGenericGuildMessage, onGenericGuildMessageReaction, onGenericGuildUpdate, onGenericGuildVoice, onGenericMessage, onGenericMessageReaction, onGenericPermissionOverride, onGenericPrivateMessage, onGenericPrivateMessageReaction, onGenericRole, onGenericRoleUpdate, onGenericSelfUpdate, onGenericStoreChannel, onGenericStoreChannelUpdate, onGenericTextChannel, onGenericTextChannelUpdate, onGenericUpdate, onGenericUser, onGenericUserPresence, onGenericVoiceChannel, onGenericVoiceChannelUpdate, onGuildAvailable, onGuildBan, onGuildInviteCreate, onGuildInviteDelete, onGuildJoin, onGuildLeave, onGuildMemberJoin, onGuildMemberLeave, onGuildMemberRemove, onGuildMemberRoleAdd, onGuildMemberRoleRemove, onGuildMemberUpdate, onGuildMemberUpdateBoostTime, onGuildMemberUpdateNickname, onGuildMessageDelete, onGuildMessageEmbed, onGuildMessageReactionAdd, onGuildMessageReactionRemove, onGuildMessageReactionRemoveAll, onGuildMessageReactionRemoveEmote, onGuildMessageReceived, onGuildMessageUpdate, onGuildReady, onGuildUnavailable, onGuildUnban, onGuildUpdateAfkChannel, onGuildUpdateAfkTimeout, onGuildUpdateBanner, onGuildUpdateBoostCount, onGuildUpdateBoostTier, onGuildUpdateDescription, onGuildUpdateExplicitContentLevel, onGuildUpdateFeatures, onGuildUpdateIcon, onGuildUpdateLocale, onGuildUpdateMaxMembers, onGuildUpdateMaxPresences, onGuildUpdateMFALevel, onGuildUpdateName, onGuildUpdateNotificationLevel, onGuildUpdateOwner, onGuildUpdateRegion, onGuildUpdateSplash, onGuildUpdateSystemChannel, onGuildUpdateVanityCode, onGuildUpdateVerificationLevel, onGuildVoiceDeafen, onGuildVoiceGuildDeafen, onGuildVoiceGuildMute, onGuildVoiceJoin, onGuildVoiceLeave, onGuildVoiceMove, onGuildVoiceMute, onGuildVoiceSelfDeafen, onGuildVoiceSelfMute, onGuildVoiceStream, onGuildVoiceSuppress, onGuildVoiceUpdate, onHttpRequest, onMessageBulkDelete, onMessageDelete, onMessageEmbed, onMessageReactionAdd, onMessageReactionRemove, onMessageReactionRemoveAll, onMessageReactionRemoveEmote, onMessageUpdate, onPermissionOverrideCreate, onPermissionOverrideDelete, onPermissionOverrideUpdate, onPrivateChannelCreate, onPrivateChannelDelete, onPrivateMessageDelete, onPrivateMessageEmbed, onPrivateMessageReactionAdd, onPrivateMessageReactionRemove, onPrivateMessageReceived, onPrivateMessageUpdate, onRawGateway, onReady, onReconnect, onResume, onRoleCreate, onRoleDelete, onRoleUpdateColor, onRoleUpdateHoisted, onRoleUpdateMentionable, onRoleUpdateName, onRoleUpdatePermissions, onRoleUpdatePosition, onSelfUpdateAvatar, onSelfUpdateEmail, onSelfUpdateMFA, onSelfUpdateName, onSelfUpdateVerified, onShutdown, onStatusChange, onStoreChannelCreate, onStoreChannelDelete, onStoreChannelUpdateName, onStoreChannelUpdatePermissions, onStoreChannelUpdatePosition, onTextChannelCreate, onTextChannelDelete, onTextChannelUpdateName, onTextChannelUpdateNews, onTextChannelUpdateNSFW, onTextChannelUpdateParent, onTextChannelUpdatePermissions, onTextChannelUpdatePosition, onTextChannelUpdateSlowmode, onTextChannelUpdateTopic, onUnavailableGuildJoined, onUnavailableGuildLeave, onUserActivityEnd, onUserActivityStart, onUserTyping, onUserUpdateActivityOrder, onUserUpdateAvatar, onUserUpdateDiscriminator, onUserUpdateFlags, onUserUpdateName, onUserUpdateOnlineStatus, onVoiceChannelCreate, onVoiceChannelDelete, onVoiceChannelUpdateBitrate, onVoiceChannelUpdateName, onVoiceChannelUpdateParent, onVoiceChannelUpdatePermissions, onVoiceChannelUpdatePosition, onVoiceChannelUpdateUserLimit
private static final java.lang.String SKIN_API
private net.dv8tion.jda.api.JDA jda
private net.dv8tion.jda.api.entities.TextChannel generalChannel
private net.dv8tion.jda.api.entities.TextChannel loggingChannel
private boolean isRunning
public WauzDiscordBot()
public void stop()
public void sendMessageFromMinecraft(java.lang.String message, boolean inLogChannel)
message
- The content of the message.inLogChannel
- If the message should be send to the log channel.public void sendEmbedFromMinecraft(org.bukkit.entity.Player player, java.lang.String title, java.lang.String description, java.awt.Color color, boolean inLogChannel)
player
- The player whose head to use in the embed image.title
- The title of the embed.description
- The description of the embed.color
- The color of the embed.inLogChannel
- If the message should be sent to the log channel.public static void sendEmbed(org.bukkit.entity.Player player, java.lang.String title, java.lang.String description, java.awt.Color color, net.dv8tion.jda.api.entities.TextChannel textChannel)
player
- The player whose head to use in the embed image.title
- The title of the embed.description
- The description of the embed.color
- The color of the embed.textChannel
- The channel to send the embed to.public void updateGeneralChannelServerStats()
SystemAnalytics
public void updateLoggingChannelServerStats()
SystemAnalytics
public void onMessageReceived(net.dv8tion.jda.api.events.message.MessageReceivedEvent event)
onMessageReceived
in class net.dv8tion.jda.api.hooks.ListenerAdapter
event
- The message event.