package Ġio . github . k obi 3 2 7 6 8 . quot eb ot Ċ Ċ import Ġnet . dv 8 tion . j da . api . Embed Builder Ċ import Ġnet . dv 8 tion . j da . api . Permission Ċ import Ġnet . dv 8 tion . j da . api . entities . Channel Type Ċ import Ġnet . dv 8 tion . j da . api . entities . Message Ċ import Ġnet . dv 8 tion . j da . api . events . message . Message Received Event Ċ import Ġjava . awt . Color Ċ Ċ fun ĠMessage Received Event . sendMessage ( message : ĠString ) Ġ{ ĊĠĠĠ Ġthis . channel . sendMessage ( message ). queue () Ċ } Ċ Ċ fun ĠMessage Received Event . send ErrorMessage ( error : ĠError ) Ġ{ ĊĠĠĠ Ġval Ġtext Ġ= Ġ"** ${ error . title }** \ n " Ġ+ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġerror . description ĊĠĠĠ Ġthis . sendMessage ( text ) Ċ } Ċ Ċ fun ĠMessage Data . is Same Guild (): ĠBoolean Ġ{ ĊĠĠĠ Ġreturn Ġthis . guild Ġ== Ġthis . event . guild Ċ } Ċ Ċ fun ĠMessage Data . is Same Channel (): ĠBoolean Ġ{ ĊĠĠĠ Ġreturn Ġthis . channel Ġ== Ġthis . event . channel Ċ } Ċ Ċ fun ĠMessage Data . is Force Quot able (): ĠBoolean Ġ{ ĊĠĠĠ Ġval Ġchannel Ġ= Ġthis . channel ĊĠĠĠ Ġval Ġmember Ġ= Ġthis . event . member !! ĊĊĠĠĠ Ġreturn Ġmember . has Permission ( channel , ĠPermission . MANAGE _ CHANNEL ) Ġ|| Ġmember . has Permission ( channel , ĠPermission . MESSAGE _ MANAGE ) Ġ|| Ġmember . has Permission ( channel , ĠPermission . ADMIN ISTR ATOR ) Ċ } Ċ Ċ fun Ġsend Regular Embed Message ( data : ĠMessage Data ) Ġ{ ĊĠĠĠ Ġval Ġguild Ġ= Ġdata . guild ĊĠĠĠ Ġval Ġchannel Ġ= Ġdata . channel ĊĠĠĠ Ġval Ġmessage Ġ= Ġdata . message ĊĠĠĠ Ġval Ġevent Ġ= Ġdata . event ĊĊĠĠĠ Ġval Ġembed Ġ= ĠEmbed Builder () ĊĠĠĠĠĠĠĠ Ġ. setTitle (" from : Ġ${ channel . name } Ġ(${ guild . name }) ") ĊĠĠĠĠĠĠĠ Ġ. setDescription ( message . content Display ) ĊĠĠĠĠĠĠĠ Ġ. set Timestamp ( message . time Created ) ĊĠĠĠĠĠĠĠ Ġ. setColor ( Color ( 2 3 8 , Ġ 1 5 0 , Ġ 1 8 1 )) ĊĊĠĠĠ Ġ// ĠIf Ġget Ġmessage Ġfrom ĠIDs , ĠAPI Ġdon 't Ġget Ġmember ĊĠĠĠ Ġif Ġ( data . is Same Guild () Ġ&& Ġmessage . is From Type ( Channel Type . TEXT )) Ġ{ ĊĠĠĠĠĠĠĠ Ġembed . set Author ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmessage . get Effective Name (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnull , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmessage . author . effective Avatar Url ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġevent . channel ĊĠĠĠĠĠĠĠ Ġ. sendMessage ( embed . build ()) ĊĠĠĠĠĠĠĠ Ġ. queue () Ċ } Ċ Ċ private Ġfun ĠMessage . get Effective Name (): ĠString Ġ{ ĊĠĠĠ Ġreturn Ġif Ġ( this . member Ġ== Ġnull ) ĊĠĠĠĠĠĠĠ Ġthis . author . name ĊĠĠĠ Ġelse ĊĠĠĠĠĠĠĠ Ġthis . member !!. effective Name Ċ } Ċ