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)
This commit is contained in:
sbsatwork 2022-12-16 16:31:37 +01:00 committed by GitHub
parent cf70522a80
commit 4cce86f5af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -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);