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
8
bot.php
8
bot.php
|
@ -87,7 +87,11 @@ $telegram = new Longman\TelegramBot\Telegram(
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
$mastodon = new MastodonClient(new Client);
|
try {
|
||||||
|
$mastodon = new MastodonClient(new Client);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
echo 'WARNING: could not start MastodonClient';
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
if (in_array($article['link'], $seen)) {
|
if (in_array($article['link'], $seen)) {
|
||||||
|
@ -130,7 +134,7 @@ foreach ($articles as $article) {
|
||||||
echo $e;
|
echo $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($config['MASTODON'] === true) {
|
if ($config['MASTODON'] === true && isset($mastodon)) {
|
||||||
$mastodon->domain($config['MASTODON_SERVER'])->token($config['MASTODON_ACCESS_TOKEN']);
|
$mastodon->domain($config['MASTODON_SERVER'])->token($config['MASTODON_ACCESS_TOKEN']);
|
||||||
/*
|
/*
|
||||||
if ($image) {
|
if ($image) {
|
||||||
|
|
Loading…
Reference in a new issue