package Ġnet . ay ata ka . k ord is . websocket . handlers . message Ċ Ċ import Ġcom . google . gson . JsonObject Ċ import Ġnet . ay ata ka . k ord is . Discord Client Impl Ċ import Ġnet . ay ata ka . k ord is . event . events . message . Message Delete Event Ċ import Ġnet . ay ata ka . k ord is . websocket . handlers . Gateway Handler Ċ Ċ class ĠMessage Delete Handler Ġ: ĠGateway Handler Ġ{ ĊĠĠĠ Ġoverride Ġval ĠeventType Ġ= Ġ" MESSAGE _ DELETE " ĊĊĠĠĠ Ġoverride Ġfun Ġhandle ( client : ĠDiscord Client Impl , Ġdata : ĠJsonObject ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠmessageId Ġ= Ġdata [" id "]. as Long ĊĊĠĠĠĠĠĠĠ Ġif Ġ(! data . has (" guild _ id ")) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġchannel Ġ= Ġclient . private Channels . find ( data [" channel _ id "]. as Long ) Ġ?: Ġreturn ĊĠĠĠĠĠĠĠĠĠĠĠ Ġclient . event Manager . fire ( Message Delete Event ( listOf ( message Id ), Ġchannel , Ġnull )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġserver Ġ= Ġclient . servers . find ( data [" guild _ id "]. as Long ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠIllegalStateException (" unknown Ġserver Ġid Ġreceived ") ĊĊĠĠĠĠĠĠĠ Ġval Ġchannel Ġ= Ġserver . text Channels . find ( data [" channel _ id "]. as Long ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠIllegalStateException (" unknown Ġchannel Ġid Ġreceived ") ĊĊĠĠĠĠĠĠĠ Ġclient . event Manager . fire ( Message Delete Event ( listOf ( message Id ), Ġchannel , Ġserver )) ĊĠĠĠ Ġ} Ċ }