Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New commands not work #11

Closed
paranoiasystem opened this issue Jul 17, 2015 · 7 comments
Closed

New commands not work #11

paranoiasystem opened this issue Jul 17, 2015 · 7 comments

Comments

@paranoiasystem
Copy link

I have wrote a new command based on help command

<?php
namespace Longman\TelegramBot\Commands;

use Longman\TelegramBot\Request;
use Longman\TelegramBot\Command;
use Longman\TelegramBot\Entities\Update;

class NicoCommand extends Command
{
    public function execute() {
        $update = $this->getUpdate();
        $message = $this->getMessage();

        $chat_id = $message->getChat()->getId();
        $text = $message->getText(true);

        $data = array();
        $data['chat_id'] = $chat_id;
        $data['text'] = "Sorry, ........";

        $result = Request::sendMessage($data);
    }
}

But when I write /nico it not work 😢

What's wrong ?

(Sorry for my bad english 😁 )

@MBoretto
Copy link
Collaborator

What is the name of the file? It have to be NicoCommand.php
On 17 Jul 2015 18:40, "Marco Ferraioli" notifications@github.com wrote:

I have wrote a new command based on help command

getUpdate(); $message = $this->getMessage(); $chat_id = $message->getChat()->getId(); $text = $message->getText(true); $data = array(); $data['chat_id'] = $chat_id; $data['text'] = "Sorry, ........"; $result = Request::sendMessage($data); }} But when I write /nico it not work [image: 😢] What's wrong ? (Sorry for my bad english [image: 😁] ) — Reply to this email directly or view it on GitHub https://github.com//issues/11.

@paranoiasystem
Copy link
Author

yes, the name is NicoCommand.php

screen

http://s10.postimg.org/smonglf15/Immagine.png

@paranoiasystem
Copy link
Author

ops I don't want close this 😕

@MBoretto
Copy link
Collaborator

Wich version of the bot you're using? this is not the last one 0.0.8 right?

@paranoiasystem
Copy link
Author

I have update the bot, but now when I set webhook I recive this error:

Webhook was not set! Error:

help me 😢

@MBoretto
Copy link
Collaborator

Try to do he request manually with this:
https://api.telegram.org/bot{yourbottoken}/setWebhook?url={yourhttpsurl}

@paranoiasystem
Copy link
Author

it work. Thanks

noplanman pushed a commit to noplanman/php-telegram-bot that referenced this issue May 27, 2016
noplanman pushed a commit that referenced this issue Aug 6, 2017
Send /cleanup response to private user chat instead of current chat.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants