package Ġr apt or . utils . command meta Ċ Ċ import Ġr apt or . handlers . CommandHandler Ċ import Ġr apt or . utils . Bot Properties Ċ import Ġnet . dv 8 tion . j da . core . Embed Builder Ċ import Ġnet . dv 8 tion . j da . core . events . message . Message Received Event Ċ import Ġjava . awt . Color Ċ Ċ abstract Ġclass ĠCommand Ġ{ ĊĠĠĠ Ġ// Command ĠLogger ĊĠĠĠ Ġprivate Ġvar Ġcommand Logger Ġ= ĠCommand Logger () ĊĊĠĠĠ Ġ// Message ĠBuilder ĊĠĠĠ Ġvar Ġembedded Message Builder : ĠEmbed Builder Ġ= ĠEmbed Builder (). setColor ( Color . RED ). clear Fields (). setTitle ( null ). setDescription ( null ) ĊĊĠĠĠ Ġ// run Command : ĠRuns Ġthe Ġcommand ĊĠĠĠ Ġabstract Ġfun Ġrun Command ( args : ĠArray < String >, Ġcommand Container : ĠCommand Handler . Command Container ) ĊĊĠĠĠ Ġ// executed : ĠLogs Ġcommand Ġand Ġreturns Ġif Ġexecuted Ġcompletely ĊĠĠĠ Ġfun Ġexecuted ( command Container : ĠCommand Handler . Command Container ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġcommand Logger . log Command ( command Container ) ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// run Help Command : ĠSend Ġhelp Ġmessage Ġusing Ġannotation Ġproperties ĊĠĠĠ Ġfun Ġrun Help Command ( command Container : ĠCommand Handler . Command Container ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsend Help Message ( command Container . event ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// get Cmd Properties : ĠReturns Ġthe Ġannotation Ġproperties ĊĠĠĠ Ġfun Ġget Cmd Properties (): ĠICommand ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġif Ġ( this . java Class . is Annotation Present ( IC ommand :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthis . java Class . getAnnotation ( IC ommand :: class . java ) ĊĠĠĠĠĠĠĠ Ġelse ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// S ends ĠEmbedded ĠMessage ĊĠĠĠ Ġfun ĠsendMessage ( event : ĠMessage Received Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġevent . text Channel . sendMessage ( embedded Message Builder . build ()). queue () ĊĠĠĠĠĠĠĠ Ġclear Embedded Builder ( embedded Message Builder ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// S ends Ġpassed ĠEmbedded ĠMessage ĊĠĠĠ Ġfun ĠsendMessage ( event : ĠMessage Received Event , Ġembedded Message Builder : ĠEmbed Builder ) Ġ{ ĊĠĠĠĠĠĠĠ Ġevent . text Channel . sendMessage ( embedded Message Builder . build ()). queue () ĊĠĠĠĠĠĠĠ Ġclear Embedded Builder ( embedded Message Builder ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// S ends ĠForm att ed ĠEmbedded ĠHelp ĠMessage ĊĠĠĠ Ġfun Ġsend Help Message ( event : ĠMessage Received Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcmd Properties Ġ= Ġthis . get Cmd Properties () ĊĠĠĠĠĠĠĠ Ġembedded Message Builder . setTitle ("${ cmd Properties ?. name } Ġ${ cmd Properties ?. emoji }") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. setDescription ( cmd Properties ?. description ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addField (" Usage ", Ġ" `` ${ Bot Properties . DEFAULT _ COMMAND _ PREFIX }${ cmd Properties ?. usage } `` ", Ġtrue ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addField (" Aliases ", Ġcmd Properties ?. aliases ?. content ToString (), Ġtrue ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addField (" Required ĠPermission ", Ġ"${ cmd Properties ?. command Permission Level }", Ġtrue ) ĊĠĠĠĠĠĠĠ ĠsendMessage ( event ) ĊĠĠĠĠĠĠĠ Ġclear Embedded Builder ( embedded Message Builder ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsend Usage Message ( event : ĠMessage Received Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcmd Properties Ġ= Ġthis . get Cmd Properties () ĊĠĠĠĠĠĠĠ Ġembedded Message Builder . setTitle ("${ cmd Properties ?. name } Ġ: no _ entry :") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addField (" Usage ", Ġ" `` ${ Bot Properties . DEFAULT _ COMMAND _ PREFIX }${ cmd Properties ?. usage } `` ", Ġtrue ) ĊĠĠĠĠĠĠĠ ĠsendMessage ( event ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// Clear s Ġthe Ġcurrent ĠEmbed Message ĊĠĠĠ Ġfun Ġclear Embedded Builder ( embedded Message Builder : ĠEmbed Builder ) Ġ= Ġembedded Message Builder . setTitle ( null ). setDescription ( null ). clear Fields () Ċ }