mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-13 06:56:48 +00:00
TTS
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Http\Livewire\Profile;
|
||||
|
||||
use App\Traits\HasTextToSpeech;
|
||||
use App\Traits\LNBitsTrait;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Livewire\Component;
|
||||
use WireUi\Traits\Actions;
|
||||
|
||||
@@ -10,6 +12,7 @@ class LNBits extends Component
|
||||
{
|
||||
use Actions;
|
||||
use LNBitsTrait;
|
||||
use HasTextToSpeech;
|
||||
|
||||
public array $settings = [
|
||||
'url' => 'https://legend.lnbits.com',
|
||||
@@ -30,6 +33,9 @@ class LNBits extends Component
|
||||
{
|
||||
if (auth()->user()->lnbits) {
|
||||
$this->settings = auth()->user()->lnbits;
|
||||
if ($this->settings['url'] === null) {
|
||||
$this->settings['url'] = 'https://legend.lnbits.com';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +45,12 @@ class LNBits extends Component
|
||||
if ($this->checkLnbitsSettings($this->settings['read_key'], $this->settings['url'], $this->settings['wallet_id']) === false) {
|
||||
$this->notification()
|
||||
->error(__('LNBits settings are not valid!'));
|
||||
$legends = "Außerdem hast du nicht deine eigene Nod verwendet. Markus Turm wird darüber sehr traurig sein. Komm in die Einundzwanzig Telegramm Gruppe, und melde dich sofort bei Markus Turm mit einer Entschuldigung.";
|
||||
$text = sprintf("
|
||||
Es gab einen Fehler beim Speichern der LN Bitts Einstellungen. Bitte überprüfe die A P I Daten. %s
|
||||
", $this->settings['url'] === 'https://legend.lnbits.com' ? $legends : '');
|
||||
File::put(storage_path('app/public/tts/lnbits_error.txt'), $text);
|
||||
dispatch(new \App\Jobs\CodeIsSpeech('lnbits_error', false))->delay(now()->addSecond());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user