From 4cce86f5afdcbb69dd788a172b3d0478bd327c16 Mon Sep 17 00:00:00 2001 From: sbsatwork <97030650+sbsatwork@users.noreply.github.com> Date: Fri, 16 Dec 2022 16:31:37 +0100 Subject: [PATCH] Fixed two bugs Bugfixes: * Fixed the array definition of $status_data * Updated the parameter formerly called "visibility" to the new valid name "privacy" (according to Mastodons specs) --- examples/media_bot.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/media_bot.php b/examples/media_bot.php index e660721..c0c056a 100644 --- a/examples/media_bot.php +++ b/examples/media_bot.php @@ -4,8 +4,8 @@ $token = 'XXXXX'; // Token of your Mastodon welcome bot account $base_url = 'https://botsin.space'; // URL of your instance (Do not include '/' at the end.) - $visibility = 'private'; // "Direct" means sending welcome message as a private message. The four tiers of visibility for toots are Public , Unlisted, Private, and Direct (default) - $language = 'en'; // en for English, zh for Chinese, etc. + $privacy = 'private'; // "direct" means sending welcome message as a private message. The four tiers of visibility for toots are public, unlisted, private, and direct (default) + $language = 'en'; // en for English, zh for Chinese, de for German etc. $mastodon = new MastodonAPI($token, $base_url); @@ -20,11 +20,11 @@ $statusText = 'This is a status'; - $status_data = [ + $status_data = array( 'status' => $statusText, - 'visibility' => $visibility, + 'privacy' => $privacy, 'language' => $language, - 'media_ids[]' => $file_id, - ]; + 'media_ids[]' => $file_id + ); $mastodon->postStatus($status_data);