Class Bot

java.lang.Object
org.deltava.discord.Bot

public class Bot extends Object
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 Details

    • init

      public static void init()
      Initializes the Discord bot.
    • disconnect

      public static void disconnect()
      Disconnects the Bot from the Discord API.
    • findChannel

      static org.javacord.api.entity.channel.ServerTextChannel findChannel(ChannelName c)
    • send

      static void send(ChannelName c, String msg)
    • send

      static void send(ChannelName c, org.javacord.api.entity.message.embed.EmbedBuilder b)
    • findRole

      static org.javacord.api.entity.permission.Role findRole(String roleName)
    • getConnection

      static Connection getConnection() throws org.gvagroup.pool.ConnectionPoolException
      Throws:
      org.gvagroup.pool.ConnectionPoolException
    • release

      static void release(Connection c)
    • getFilter

      static ContentFilter 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

      public static void resetRoles(Pilot p)
      Removes a Pilot's Discord roles.
      Parameters:
      p - the Pilot
    • getPilot

      static Pilot getPilot(String id)
      Looks up a pilot based on their Discord ID.
      Parameters:
      id - the Discord ID
      Returns:
      the Pilot, or null if not found
    • 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 Pilot
      roles - the Discord user Roles
    • sendFlightReport

      public static void sendFlightReport(FlightReport fr, Pilot p)
      Sends a Flight Report notification. This is a hacky exposure to prevent opening up all the Discord classes to IPCDaemon.
      Parameters:
      fr - a FlightReport
      p - a Pilot