Загрузка...

Error: Object of class stdClass could not be converted to string

Тема в разделе Backend создана пользователем Tanc4ik228 25 мар 2023. 207 просмотров

  1. Tanc4ik228
    Tanc4ik228 Автор темы 25 мар 2023 1 16 фев 2021
    PHP
      private function _getData() {
    $embed = $this->embed;
    $embeds = $this->embeds;
    if ($embed || $embeds) {
    // sort embeds by key first before adding the main embed so it doesn't change the order
    ksort($embeds);
    if ($embed) array_splice($embeds, $this->_offsetIndex, 0, [$embed]);
    }
    $data = [
    "content" => $this->content,
    "username" => $this->username,
    "avatar_url" => $this->avatarUrl,
    "tts" => $this->tts,
    "allowed_mentions" => $this->allowedMentions,
    "flags" => $this->flags,
    "embeds" => $embeds,
    "attachments" => $this->attachments,
    "thread_name" => $this->threadName,
    ];
    return json_encode($data);
    }
    Вот эта строка return json_encode($data); еррорит
     
    1. ResidentProxy
    2. Tanc4ik228 Автор темы
  2. yiff
    yiff 25 мар 2023 2919 11 янв 2021
    PHP
    $data = array(
    "content" => $this->content, "username" => $this->username, "avatar_url" => $this->avatarUrl, "tts" => $this->tts, "allowed_mentions" => $this->allowedMentions, "flags" => $this->flags, "embeds" => $embeds, "attachments" => $this->attachments, "thread_name" => $this->threadName,
    );
    Так попробуй
     
    25 мар 2023 Изменено
    1. Tanc4ik228 Автор темы
Загрузка...
Top