/* Ċ Ġ* ĠĠ ĠCopyright Ġ( C ) Ġ 2 0 1 7 - 2 0 1 8 ĠZe ĠH ao ĠX iao Ċ Ġ* Ċ Ġ* ĠĠ ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* ĠĠ Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠĠ ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠĠ ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* ĠĠ Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠĠ ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠĠ ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* ĠĠ Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ package Ġcom . github . kv nx iao . discord . me ire i . d 4 j . tests Ċ Ċ import Ġcom . github . kv nx iao . discord . me ire i . Me ire i Ċ import Ġcom . github . kv nx iao . discord . me ire i . command . Command Context Ċ import Ġcom . github . kv nx iao . discord . me ire i . command . Command Package Ċ import Ġcom . github . kv nx iao . discord . me ire i . command . Command Properties Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . Me ire i D 4 J Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . command . Command Builder Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . command . Command D 4 J Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . command . build Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . permission . Permission Properties D 4 J Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . send Buffered Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . tests . annotated . Annotated Command Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . tests . annotated . Nested Annotated Command Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . tests . annotated . Permission Command Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . tests . annotated . Ready Listener Command Ċ import Ġcom . github . kv nx iao . discord . me ire i . d 4 j . tests . annotated . Registry Aware Command Ċ import Ġsx . blah . discord . api . Client Builder Ċ import Ġsx . blah . discord . handle . impl . events . guild . channel . message . Message Received Event Ċ Ċ fun Ġmain ( args : ĠArray < String >) Ġ{ ĊĠĠĠ Ġval Ġtoken Ġ= ĠSystem . getenv (" TEST _ BOT _ TOKEN ") ĊĠĠĠ Ġrequire NotNull ( token , Ġ{ Ġ" The Ġenvironment Ġvariable Ġ' TEST _ BOT _ TOKEN ' Ġmust Ġbe Ġset Ġfor Ġlogging Ġin ." Ġ}) ĊĠĠĠ Ġval Ġclient Ġ= ĠClient Builder () ĊĠĠĠĠĠĠĠ Ġ. with Token ( token ). build () ĊĊĠĠĠ Ġ// ĠAdd ĠMe ire i Ġto Ġdiscord Ġclient ĊĠĠĠ Ġval Ġme ire i : ĠMe ire i Ġ= ĠMe ire i D 4 J ( client ) ĊĊĠĠĠ Ġ// ĠAdd Ġcommand Ġcreated Ġthrough Ġconstructors ĊĠĠĠ Ġval Ġconstructor Command Id Ġ= Ġ" test . constructor " ĊĠĠĠ Ġval Ġcommand Ġ= Ġobject Ġ: ĠCommand D 4 J ( constructor Command Id ) Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġexecute ( context : ĠCommand Context , Ġevent : ĠMessage Received Event ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent . channel . send Buffered (" This Ġis Ġa Ġcommand Ġcreated Ġusing Ġconstructors .") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġconstructor Sub Command Id Ġ= Ġ" test . constructor . child " ĊĠĠĠ Ġval Ġsub Command Ġ= Ġobject Ġ: ĠCommand D 4 J ( constructor Sub Command Id ) Ġ{ ĊĠĠĠĠĠĠĠ Ġoverride Ġfun Ġexecute ( context : ĠCommand Context , Ġevent : ĠMessage Received Event ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent . channel . send Buffered (" This Ġis Ġa Ġchild Ġcommand Ġcreated Ġusing Ġconstructors .") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠConstructor - based Ġcommand Ġand Ġsub - command ĊĠĠĠ Ġme ire i . add Commands ( ĊĠĠĠĠĠĠĠ ĠCommand Package ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcommand , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCommand Properties ( constructor Command Id , Ġaliases Ġ= Ġset Of (" constructor ", Ġ" cons "), Ġexec With Sub Commands Ġ= Ġtrue ), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPermission Properties D 4 J () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġme ire i . add Sub Commands ( constructor Command Id , ĊĠĠĠĠĠĠĠ ĠCommand Package ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsub Command , ĊĠĠĠĠĠĠĠĠĠĠĠ ĠCommand Properties ( constructor Sub Command Id , Ġaliases Ġ= Ġset Of (" child ")), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠPermission Properties D 4 J () ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġ// ĠBuilder - based Ġcommand ĊĠĠĠ Ġme ire i . add Commands ( Command Builder (" test . builder ") ĊĠĠĠĠĠĠĠ Ġ. aliases (" builder ") ĊĠĠĠĠĠĠĠ Ġ. build Ġ{ Ġ_, Ġevent Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent . channel . send Buffered (" This Ġcommand Ġwas Ġcreated Ġusing Ġa ĠCommand Builder Ġclass .") ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ) ĊĠĠĠ Ġ// ĠAdd Ġannotation - based Ġcommands ĊĠĠĠ Ġme ire i . add Annotated Commands ( ĊĠĠĠĠĠĠĠ ĠAnnot ated Command (), ĊĠĠĠĠĠĠĠ ĠNested Annotated Command (), ĊĠĠĠĠĠĠĠ ĠPermission Command (), ĊĠĠĠĠĠĠĠ ĠRegistry Aware Command (), ĊĠĠĠĠĠĠĠ ĠReady Listener Command () ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġ// ĠLog Ġin Ġto Ġdiscord ĊĠĠĠ Ġclient . login () Ċ } Ċ