Skip to content

Commit

Permalink
Fix #85 - Unknown message type on delete
Browse files Browse the repository at this point in the history
  • Loading branch information
JaxkDev committed May 21, 2023
1 parent e6390ba commit e5b7892
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Bot/Handlers/DiscordEventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,16 @@ public function onMessageUpdate(DiscordMessage $message, Discord $discord): void

public function onMessageDelete(DiscordMessage|\stdClass $data, Discord $discord): void{
if($data instanceof DiscordMessage){
$message = ModelConverter::genModelMessage($data);
if(!$this->checkMessage($data)){
//Unknown message type deleted (send basic details TODO decide for future).
$message = [
"message_id" => $data->id,
"channel_id" => $data->channel_id,
"server_id" => $data->guild_id
];
}else{
$message = ModelConverter::genModelMessage($data);
}
}else{
$message = [
"message_id" => $data->id,
Expand Down

0 comments on commit e5b7892

Please sign in to comment.