Upgade to v2 #62
-
Sorry to trouble you. I have upgraded to v2, but hitting error when running command such as setup webhook. Error: Class Any help would be appreciated. <?php
namespace App\TelBot;
use App\Http\Controllers\UserGateController;
use Illuminate\Support\Facades\Log;
use WeStacks\TeleBot\Interfaces\UpdateHandler;
use WeStacks\TeleBot\Objects\Update;
use WeStacks\TeleBot\TeleBot;
class Gateway extends UpdateHandler
{
public static function trigger(Update $update, TeleBot $bot): bool
{
return isset($update->message); // handle regular messages (example)
}
public function handle()
{
$userGate = new UserGateController();
// Log User who starts the Bot
$userGate->saveUser($this->update);
// Is User Allowed To Access The Bot?
if ($userGate->isBotAccessAllowed($this->update) == false) {
// Stop future commands from processing
$userGate->denyUserAlertAdmin($this->update);
// Kill future commands
exit();
}
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
punyflash
Dec 25, 2022
Replies: 4 comments 2 replies
-
In v2, classes:
changed their namespaces to:
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
punyflash
-
Thank you. Ill test this out. Is it possible to update the docs here: https://westacks.github.io/telebot/#/updates?id=creating-handlers with the new namespaces.
… On 25 Dec 2022, at 01:15, Dmytro Morozov ***@***.***> wrote:
In v2 <https://github.com/westacks/telebot/blob/master/CHANGELOG.md#200---2022-06-06>, classes:
WeStacks\TeleBot\Interfaces\CommandHandler
WeStacks\TeleBot\Interfaces\UpdateHandler
changed their namespaces to:
WeStacks\TeleBot\Handlers\CommandHandler
WeStacks\TeleBot\Handlers\UpdateHandler
—
Reply to this email directly, view it on GitHub <#62 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMFIMNSUW5DNG4Q6DPLGLBDWO6N3HANCNFSM6AAAAAATIVDA2E>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
https://westacks.github.io/telebot/#/updates?id=creating-handlers
Still has: use WeStacks\TeleBot\Interfaces\UpdateHandler;
I dont know the full fix or I would do a PR.
… On 27 Dec 2022, at 07:00, Dmytro Morozov ***@***.***> wrote:
Docs are written according to latest version, there is nothing to change. If you find a mistake in the docs, I'll gladly accept a pull request.
—
Reply to this email directly, view it on GitHub <#62 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AMFIMNUUCKFE5ZTQ4TJC4HLWPKHXPANCNFSM6AAAAAATIVDA2E>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Thank you. Kind regardsDavid WhickerOn 31 Dec 2022, at 07:41, Dmytro Morozov ***@***.***> wrote:
I see now. Ok, I'll fix doc with patch for bit api 6.4
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In v2, classes:
WeStacks\TeleBot\Interfaces\CommandHandler
WeStacks\TeleBot\Interfaces\UpdateHandler
changed their namespaces to:
WeStacks\TeleBot\Handlers\CommandHandler
WeStacks\TeleBot\Handlers\UpdateHandler