isInsert() ){ $contentId = $this->content_id; $contentType = $this->content_type; \XF::runLater(function () use ($contentId, $contentType) { $entity = \XF::app()->getContentTypeFieldValue($contentType, 'entity'); if( !$entity ){ return; } $content = \XF::em()->find($entity, $contentId); $user = $contentType === 'user' ? $content : $content->User; $service = \XF::service('RomhackPlaza\Master:Discord\BotService'); $service->createAction( 'approval_queue', [ 'content_title' => Helpers::getContentTitle( $content, $contentType ), 'approval_item_url' => \XF::app()->router('public')->buildLink('canonical:approval-queue' ), 'approval_username' => $user?->username ?? '', 'approval_user_url' => $user?->user_id ? \XF::app()->router('public')->buildLink('canonical:members', $user ) : '', 'content_type' => $contentType, ]); }); } } }