Package com.github.mafelp.commands
Class BirthdayCommand
java.lang.Object
java.lang.Thread
com.github.mafelp.commands.BirthdayCommand
- All Implemented Interfaces:
java.lang.Runnable
public class BirthdayCommand
extends java.lang.Thread
The class that handles asynchronous execution of the Birthday command.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler -
Field Summary
Fields Modifier and Type Field Description private CommandcommandThe command which was being parsed with theCommandParsercommand parser.private static org.apache.logging.log4j.LoggerloggerThe logger which is used to log statements to the console.private org.javacord.api.event.message.MessageCreateEventmessageCreateEventThe Event that is being passed to this class by the discord API.private static longthreadIDThe number of threads of this kind that were being created.Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors Constructor Description BirthdayCommand(Command command, org.javacord.api.event.message.MessageCreateEvent messageCreateEvent) -
Method Summary
Modifier and Type Method Description voidrun()The method handles the actual execution of this command.private voidsendHelpMessage(boolean wrongUsage)The method that handles sending the message on wrong usage or when the help argument was supplied.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yieldMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
logger
private static final org.apache.logging.log4j.Logger loggerThe logger which is used to log statements to the console. -
messageCreateEvent
private final org.javacord.api.event.message.MessageCreateEvent messageCreateEventThe Event that is being passed to this class by the discord API. -
command
The command which was being parsed with theCommandParsercommand parser. -
threadID
private static long threadIDThe number of threads of this kind that were being created.
-
-
Constructor Details
-
BirthdayCommand
public BirthdayCommand(Command command, org.javacord.api.event.message.MessageCreateEvent messageCreateEvent)- Parameters:
command- The command which was being parsed with theCommandParsercommand parser.messageCreateEvent- The Event that is being passed to this class by the discord API.
-
-
Method Details
-
run
public void run()The method handles the actual execution of this command.- Specified by:
runin interfacejava.lang.Runnable- Overrides:
runin classjava.lang.Thread
-
sendHelpMessage
private void sendHelpMessage(boolean wrongUsage)The method that handles sending the message on wrong usage or when the help argument was supplied.- Parameters:
wrongUsage- If the message should contain text, that says the command was wrongly used.
-