Skip to content

#1048: Update code examples to reflect namespace changes #38

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Commands/CallbackqueryCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\SystemCommand;
use PhpTelegramBot\Core\Request;

/**
* Callback query command
@@ -40,8 +40,8 @@ class CallbackqueryCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
22 changes: 11 additions & 11 deletions Commands/CancelCommand.php
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Conversation;
use Longman\TelegramBot\Entities\Keyboard;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Conversation;
use PhpTelegramBot\Core\Entities\Keyboard;
use PhpTelegramBot\Core\Request;

/**
* User "/cancel" command
@@ -52,8 +52,8 @@ class CancelCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
@@ -78,8 +78,8 @@ public function execute()
*
* @param string $text
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
private function removeKeyboard($text)
{
@@ -93,8 +93,8 @@ private function removeKeyboard($text)
/**
* Command execute method if MySQL is required but not available
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function executeNoDb()
{
8 changes: 4 additions & 4 deletions Commands/ChannelchatcreatedCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Channel chat created command
@@ -37,8 +37,8 @@ class ChannelchatcreatedCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/ChannelpostCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Channel post command
@@ -37,8 +37,8 @@ class ChannelpostCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/ChoseninlineresultCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Chosen inline result command
@@ -37,8 +37,8 @@ class ChoseninlineresultCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
14 changes: 7 additions & 7 deletions Commands/DateCommand.php
Original file line number Diff line number Diff line change
@@ -8,13 +8,13 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use Longman\TelegramBot\TelegramLog;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Request;
use PhpTelegramBot\Core\TelegramLog;

/**
* User "/date" command
@@ -183,7 +183,7 @@ private function validateResponseData($data)
* @param string $location
*
* @return string
* @throws \Longman\TelegramBot\Exception\TelegramException
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
private function getFormattedDate($location)
{
@@ -206,8 +206,8 @@ private function getFormattedDate($location)
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/DeletechatphotoCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Delete chat photo command
@@ -37,8 +37,8 @@ class DeletechatphotoCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/EchoCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Request;

/**
* User "/echo" command
@@ -43,8 +43,8 @@ class EchoCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/EditedchannelpostCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Edited channel post command
@@ -37,8 +37,8 @@ class EditedchannelpostCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/EditedmessageCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Edited message command
@@ -37,8 +37,8 @@ class EditedmessageCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/EditmessageCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Request;

/**
* User "/editmessage" command
@@ -43,8 +43,8 @@ class EditmessageCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
12 changes: 6 additions & 6 deletions Commands/ForcereplyCommand.php
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\Keyboard;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Entities\Keyboard;
use PhpTelegramBot\Core\Request;

/**
* User "/forcereply" command
@@ -44,8 +44,8 @@ class ForcereplyCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/GenericCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\SystemCommand;
use PhpTelegramBot\Core\Request;

/**
* Generic command
@@ -38,8 +38,8 @@ class GenericCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
16 changes: 8 additions & 8 deletions Commands/GenericmessageCommand.php
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Conversation;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\SystemCommand;
use PhpTelegramBot\Core\Conversation;
use PhpTelegramBot\Core\Request;

/**
* Generic message command
@@ -44,8 +44,8 @@ class GenericmessageCommand extends SystemCommand
/**
* Command execute method if MySQL is required but not available
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function executeNoDb()
{
@@ -56,8 +56,8 @@ public function executeNoDb()
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/GroupchatcreatedCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Group chat created command
@@ -37,8 +37,8 @@ class GroupchatcreatedCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/HelpCommand.php
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\Command;
use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\Command;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Request;

/**
* User "/help" command
12 changes: 6 additions & 6 deletions Commands/HidekeyboardCommand.php
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\Keyboard;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Entities\Keyboard;
use PhpTelegramBot\Core\Request;

/**
* User "/hidekeyboard" command
@@ -44,8 +44,8 @@ class HidekeyboardCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/ImageCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Request;

/**
* User "/image" command
@@ -43,8 +43,8 @@ class ImageCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
12 changes: 6 additions & 6 deletions Commands/InlinekeyboardCommand.php
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\InlineKeyboard;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Entities\InlineKeyboard;
use PhpTelegramBot\Core\Request;

/**
* User "/inlinekeyboard" command
@@ -44,8 +44,8 @@ class InlinekeyboardCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
14 changes: 7 additions & 7 deletions Commands/InlinequeryCommand.php
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Entities\InlineQuery\InlineQueryResultArticle;
use Longman\TelegramBot\Entities\InputMessageContent\InputTextMessageContent;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\SystemCommand;
use PhpTelegramBot\Core\Entities\InlineQuery\InlineQueryResultArticle;
use PhpTelegramBot\Core\Entities\InputMessageContent\InputTextMessageContent;
use PhpTelegramBot\Core\Request;

/**
* Inline query command
@@ -40,8 +40,8 @@ class InlinequeryCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
12 changes: 6 additions & 6 deletions Commands/KeyboardCommand.php
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\Keyboard;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Entities\Keyboard;
use PhpTelegramBot\Core\Request;

/**
* User "/keyboard" command
@@ -44,8 +44,8 @@ class KeyboardCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/LeftchatmemberCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Left chat member command
@@ -37,8 +37,8 @@ class LeftchatmemberCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
12 changes: 6 additions & 6 deletions Commands/MarkdownCommand.php
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\ReplyKeyboardMarkup;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Entities\ReplyKeyboardMarkup;
use PhpTelegramBot\Core\Request;

/**
* User "/markdown" command
@@ -44,8 +44,8 @@ class MarkdownCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/MigratefromchatidCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Migrate from chat id command
@@ -37,8 +37,8 @@ class MigratefromchatidCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/MigratetochatidCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Migrate to chat id command
@@ -37,8 +37,8 @@ class MigratetochatidCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/NewchatmembersCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\SystemCommand;
use PhpTelegramBot\Core\Request;

/**
* New chat member command
@@ -36,8 +36,8 @@ class NewchatmembersCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/NewchatphotoCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* New chat photo command
@@ -37,8 +37,8 @@ class NewchatphotoCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/NewchattitleCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* New chat title command
@@ -37,8 +37,8 @@ class NewchattitleCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/PinnedmessageCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Pinned message command
@@ -37,8 +37,8 @@ class PinnedmessageCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/SlapCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Request;

/**
* User "/slap" command
@@ -43,8 +43,8 @@ class SlapCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/StartCommand.php
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\SystemCommand;
use PhpTelegramBot\Core\Request;

/**
* Start command
@@ -48,8 +48,8 @@ class StartCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
8 changes: 4 additions & 4 deletions Commands/SupergroupchatcreatedCommand.php
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\SystemCommands;
namespace PhpTelegramBot\Core\Commands\SystemCommands;

use Longman\TelegramBot\Commands\SystemCommand;
use PhpTelegramBot\Core\Commands\SystemCommand;

/**
* Super group chat created command
@@ -37,8 +37,8 @@ class SupergroupchatcreatedCommand extends SystemCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
20 changes: 10 additions & 10 deletions Commands/SurveyCommand.php
Original file line number Diff line number Diff line change
@@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Conversation;
use Longman\TelegramBot\Entities\Keyboard;
use Longman\TelegramBot\Entities\KeyboardButton;
use Longman\TelegramBot\Entities\PhotoSize;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Conversation;
use PhpTelegramBot\Core\Entities\Keyboard;
use PhpTelegramBot\Core\Entities\KeyboardButton;
use PhpTelegramBot\Core\Entities\PhotoSize;
use PhpTelegramBot\Core\Request;

/**
* User "/survey" command
@@ -57,15 +57,15 @@ class SurveyCommand extends UserCommand
/**
* Conversation Object
*
* @var \Longman\TelegramBot\Conversation
* @var \PhpTelegramBot\Core\Conversation
*/
protected $conversation;

/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
10 changes: 5 additions & 5 deletions Commands/UploadCommand.php
Original file line number Diff line number Diff line change
@@ -8,12 +8,12 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Conversation;
use Longman\TelegramBot\Entities\Keyboard;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Conversation;
use PhpTelegramBot\Core\Entities\Keyboard;
use PhpTelegramBot\Core\Request;

/**
* User "/upload" command
12 changes: 6 additions & 6 deletions Commands/WeatherCommand.php
Original file line number Diff line number Diff line change
@@ -8,14 +8,14 @@
* file that was distributed with this source code.
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Request;
use Longman\TelegramBot\TelegramLog;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Request;
use PhpTelegramBot\Core\TelegramLog;

/**
* User "/weather" command
@@ -124,8 +124,8 @@ private function getWeatherString(array $data)
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
16 changes: 8 additions & 8 deletions Commands/WhoamiCommand.php
Original file line number Diff line number Diff line change
@@ -10,13 +10,13 @@
* Written by Marco Boretto <marco.bore@gmail.com>
*/

namespace Longman\TelegramBot\Commands\UserCommands;
namespace PhpTelegramBot\Core\Commands\UserCommands;

use Longman\TelegramBot\Commands\UserCommand;
use Longman\TelegramBot\Entities\File;
use Longman\TelegramBot\Entities\PhotoSize;
use Longman\TelegramBot\Entities\UserProfilePhotos;
use Longman\TelegramBot\Request;
use PhpTelegramBot\Core\Commands\UserCommand;
use PhpTelegramBot\Core\Entities\File;
use PhpTelegramBot\Core\Entities\PhotoSize;
use PhpTelegramBot\Core\Entities\UserProfilePhotos;
use PhpTelegramBot\Core\Request;

/**
* User "/whoami" command
@@ -53,8 +53,8 @@ class WhoamiCommand extends UserCommand
/**
* Command execute method
*
* @return \Longman\TelegramBot\Entities\ServerResponse
* @throws \Longman\TelegramBot\Exception\TelegramException
* @return \PhpTelegramBot\Core\Entities\ServerResponse
* @throws \PhpTelegramBot\Core\Exception\TelegramException
*/
public function execute()
{
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "telegram-bot/example-bot",
"name": "php-telegram-bot/example-bot",
"type": "project",
"description": "PHP Telegram Bot Example",
"keywords": ["telegram", "bot", "example"],
@@ -17,6 +17,6 @@
}
],
"require": {
"longman/telegram-bot": "*"
"php-telegram-bot/core": "*"
}
}
10 changes: 5 additions & 5 deletions cron.php
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@

try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
$telegram = new PhpTelegramBot\Core\Telegram($bot_api_key, $bot_username);

// Add commands paths containing your custom commands
$telegram->addCommandsPaths($commands_paths);
@@ -53,7 +53,7 @@
// https://github.com/php-telegram-bot/core/blob/master/doc/01-utils.md#logging
//
// (this example requires Monolog: composer require monolog/monolog)
//Longman\TelegramBot\TelegramLog::initialize(
//PhpTelegramBot\Core\TelegramLog::initialize(
// new Monolog\Logger('telegram_bot', [
// (new Monolog\Handler\StreamHandler(__DIR__ . "/{$bot_username}_debug.log", Logger::DEBUG))->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true)),
// (new Monolog\Handler\StreamHandler(__DIR__ . "/{$bot_username}_error.log", Logger::ERROR))->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true)),
@@ -77,12 +77,12 @@
// Run user selected commands
$telegram->runCommands($commands);

} catch (Longman\TelegramBot\Exception\TelegramException $e) {
} catch (PhpTelegramBot\Core\Exception\TelegramException $e) {
// Silence is golden!
//echo $e;
// Log telegram errors
Longman\TelegramBot\TelegramLog::error($e);
} catch (Longman\TelegramBot\Exception\TelegramLogException $e) {
PhpTelegramBot\Core\TelegramLog::error($e);
} catch (PhpTelegramBot\Core\Exception\TelegramLogException $e) {
// Silence is golden!
// Uncomment this to catch log initialisation errors
//echo $e;
10 changes: 5 additions & 5 deletions getUpdatesCLI.php
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@

try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
$telegram = new PhpTelegramBot\Core\Telegram($bot_api_key, $bot_username);

// Add commands paths containing your custom commands
$telegram->addCommandsPaths($commands_paths);
@@ -51,7 +51,7 @@
// https://github.com/php-telegram-bot/core/blob/master/doc/01-utils.md#logging
//
// (this example requires Monolog: composer require monolog/monolog)
//Longman\TelegramBot\TelegramLog::initialize(
//PhpTelegramBot\Core\TelegramLog::initialize(
// new Monolog\Logger('telegram_bot', [
// (new Monolog\Handler\StreamHandler(__DIR__ . "/{$bot_username}_debug.log", Logger::DEBUG))->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true)),
// (new Monolog\Handler\StreamHandler(__DIR__ . "/{$bot_username}_error.log", Logger::ERROR))->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true)),
@@ -82,11 +82,11 @@
echo date('Y-m-d H:i:s', time()) . ' - Failed to fetch updates' . PHP_EOL;
echo $server_response->printError();
}
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
} catch (PhpTelegramBot\Core\Exception\TelegramException $e) {
echo $e->getMessage();
// Log telegram errors
Longman\TelegramBot\TelegramLog::error($e);
} catch (Longman\TelegramBot\Exception\TelegramLogException $e) {
PhpTelegramBot\Core\TelegramLog::error($e);
} catch (PhpTelegramBot\Core\Exception\TelegramLogException $e) {
// Catch log initialisation errors
echo $e->getMessage();
}
10 changes: 5 additions & 5 deletions hook.php
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@

try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
$telegram = new PhpTelegramBot\Core\Telegram($bot_api_key, $bot_username);

// Add commands paths containing your custom commands
$telegram->addCommandsPaths($commands_paths);
@@ -50,7 +50,7 @@
// https://github.com/php-telegram-bot/core/blob/master/doc/01-utils.md#logging
//
// (this example requires Monolog: composer require monolog/monolog)
//Longman\TelegramBot\TelegramLog::initialize(
//PhpTelegramBot\Core\TelegramLog::initialize(
// new Monolog\Logger('telegram_bot', [
// (new Monolog\Handler\StreamHandler(__DIR__ . "/{$bot_username}_debug.log", Logger::DEBUG))->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true)),
// (new Monolog\Handler\StreamHandler(__DIR__ . "/{$bot_username}_error.log", Logger::ERROR))->setFormatter(new Monolog\Formatter\LineFormatter(null, null, true)),
@@ -74,12 +74,12 @@
// Handle telegram webhook request
$telegram->handle();

} catch (Longman\TelegramBot\Exception\TelegramException $e) {
} catch (PhpTelegramBot\Core\Exception\TelegramException $e) {
// Silence is golden!
//echo $e;
// Log telegram errors
Longman\TelegramBot\TelegramLog::error($e);
} catch (Longman\TelegramBot\Exception\TelegramLogException $e) {
PhpTelegramBot\Core\TelegramLog::error($e);
} catch (PhpTelegramBot\Core\Exception\TelegramLogException $e) {
// Silence is golden!
// Uncomment this to catch log initialisation errors
//echo $e;
6 changes: 3 additions & 3 deletions manager.php
Original file line number Diff line number Diff line change
@@ -77,12 +77,12 @@
// Run the bot!
$bot->run();

} catch (Longman\TelegramBot\Exception\TelegramException $e) {
} catch (PhpTelegramBot\Core\Exception\TelegramException $e) {
// Silence is golden!
//echo $e;
// Log telegram errors
Longman\TelegramBot\TelegramLog::error($e);
} catch (Longman\TelegramBot\Exception\TelegramLogException $e) {
PhpTelegramBot\Core\TelegramLog::error($e);
} catch (PhpTelegramBot\Core\Exception\TelegramLogException $e) {
// Silence is golden!
// Uncomment this to catch log initialisation errors
//echo $e;
4 changes: 2 additions & 2 deletions set.php
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@

try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
$telegram = new PhpTelegramBot\Core\Telegram($bot_api_key, $bot_username);

// Set webhook
$result = $telegram->setWebhook($hook_url);
@@ -28,6 +28,6 @@
if ($result->isOk()) {
echo $result->getDescription();
}
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
} catch (PhpTelegramBot\Core\Exception\TelegramException $e) {
echo $e->getMessage();
}
4 changes: 2 additions & 2 deletions unset.php
Original file line number Diff line number Diff line change
@@ -14,14 +14,14 @@

try {
// Create Telegram API object
$telegram = new Longman\TelegramBot\Telegram($bot_api_key, $bot_username);
$telegram = new PhpTelegramBot\Core\Telegram($bot_api_key, $bot_username);

// Delete webhook
$result = $telegram->deleteWebhook();

if ($result->isOk()) {
echo $result->getDescription();
}
} catch (Longman\TelegramBot\Exception\TelegramException $e) {
} catch (PhpTelegramBot\Core\Exception\TelegramException $e) {
echo $e->getMessage();
}