Skip to content

Laravel telebot config on database #99

Answered by punyflash
ferilagi asked this question in Q&A
Discussion options

You must be logged in to vote

You can, but use TelegramNotification correctly:

return (new TelegramNotification)->bot('my-bot')->sendMessage(...)

and create the bot in service provicer first:

public function boot(): void
{
    if ($token = SecretData::where('name', 'token_telegram')->value('data')) {
         config(["telebot.bots.my-bot" => compact('token')]);
    }
}

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@ferilagi
Comment options

@punyflash
Comment options

Answer selected by ferilagi
@ferilagi
Comment options

@punyflash
Comment options

@ferilagi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #98 on December 11, 2023 09:32.