mirror of
https://gitlab.com/ifiction/ifhub-telegram.git
synced 2024-10-22 22:15:31 +00:00
catch masto errors
This commit is contained in:
parent
fe3a6cca86
commit
6570852c6b
1 changed files with 6 additions and 2 deletions
6
bot.php
6
bot.php
|
@ -87,7 +87,11 @@ $telegram = new Longman\TelegramBot\Telegram(
|
|||
return;
|
||||
};
|
||||
}
|
||||
try {
|
||||
$mastodon = new MastodonClient(new Client);
|
||||
} catch (\Exception $e) {
|
||||
echo 'WARNING: could not start MastodonClient';
|
||||
}
|
||||
|
||||
foreach ($articles as $article) {
|
||||
if (in_array($article['link'], $seen)) {
|
||||
|
@ -130,7 +134,7 @@ foreach ($articles as $article) {
|
|||
echo $e;
|
||||
}
|
||||
}
|
||||
if ($config['MASTODON'] === true) {
|
||||
if ($config['MASTODON'] === true && isset($mastodon)) {
|
||||
$mastodon->domain($config['MASTODON_SERVER'])->token($config['MASTODON_ACCESS_TOKEN']);
|
||||
/*
|
||||
if ($image) {
|
||||
|
|
Loading…
Reference in a new issue