Class Bot
java.lang.Object
org.deltava.discord.Bot
The Discord Bot. This has a number of static methods that serve as the entry point to Discord operations from other code.
- Since:
- 11.0
- Version:
- 12.3
- Author:
- danielw, luke
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassignNickname(Pilot p, Collection<org.javacord.api.entity.permission.Role> roles) Assigns a nikcname to a Pilot.static voidDisconnects the Bot from the Discord API.(package private) static org.javacord.api.entity.channel.ServerTextChannel(package private) static org.javacord.api.entity.permission.Role(package private) static Connection(package private) static ContentFilter(package private) static PilotLooks up a pilot based on their Discord ID.static voidinit()Initializes the Discord bot.static booleanChecks if the Discord bot has been initialized.(package private) static voidstatic voidresetRoles(Pilot p) Removes a Pilot's Discord roles.(package private) static voidsend(ChannelName c, String msg) (package private) static voidsend(ChannelName c, org.javacord.api.entity.message.embed.EmbedBuilder b) static voidsendFlightReport(FlightReport fr, Pilot p) Sends a Flight Report notification.
-
Method Details
-
init
public static void init()Initializes the Discord bot. -
disconnect
public static void disconnect()Disconnects the Bot from the Discord API. -
findChannel
-
send
-
send
-
findRole
-
getConnection
- Throws:
org.gvagroup.pool.ConnectionPoolException
-
release
-
getFilter
-
isInitialized
public static boolean isInitialized()Checks if the Discord bot has been initialized.- Returns:
- TRUE if initialized and connected to the Discord server, otherwise FALSE
-
resetRoles
-
getPilot
-
assignNickname
public static void assignNickname(Pilot p, Collection<org.javacord.api.entity.permission.Role> roles) Assigns a nikcname to a Pilot. This is called on registration or when a Pilot's Pilot ID is first assigned.- Parameters:
p- the Pilotroles- the Discord user Roles
-
sendFlightReport
Sends a Flight Report notification. This is a hacky exposure to prevent opening up all the Discord classes to IPCDaemon.- Parameters:
fr- a FlightReportp- a Pilot
-