diff --git a/cpanfile b/cpanfile index 7d262fd..055ec37 100644 --- a/cpanfile +++ b/cpanfile @@ -10,6 +10,5 @@ requires 'JSON'; requires 'JSON::XS'; requires 'JSON::PP'; requires 'Mojo::Base'; -requires 'Telegram::Bot'; requires 'URI::URL'; requires 'local::lib'; diff --git a/lib/Telegram/Bot.pm b/lib/Teapot/Bot.pm similarity index 90% rename from lib/Telegram/Bot.pm rename to lib/Teapot/Bot.pm index be9b43b..c16a8dc 100644 --- a/lib/Telegram/Bot.pm +++ b/lib/Teapot/Bot.pm @@ -1,5 +1,5 @@ -package Telegram::Bot; -$Telegram::Bot::VERSION = '0.021'; +package Teapot::Bot; +$Teapot::Bot::VERSION = '0.021'; use strict; use warnings; @@ -16,7 +16,7 @@ __END__ =head1 NAME -Telegram::Bot - A base class to make your very own Telegram bot +Teapot::Bot - A base class to make your very own Telegram bot =head1 VERSION @@ -30,7 +30,7 @@ Creating a bot is easy: package MyBot; - use Mojo::Base 'Telegram::Bot::Brain'; + use Mojo::Base 'Teapot::Bot::Brain'; has token => 'YOURTOKENHERE'; diff --git a/lib/Telegram/Bot/Brain.pm b/lib/Teapot/Bot/Brain.pm similarity index 83% rename from lib/Telegram/Bot/Brain.pm rename to lib/Teapot/Bot/Brain.pm index 3a3123e..aee8343 100644 --- a/lib/Telegram/Bot/Brain.pm +++ b/lib/Teapot/Bot/Brain.pm @@ -1,5 +1,5 @@ -package Telegram::Bot::Brain; -$Telegram::Bot::Brain::VERSION = '0.021'; +package Teapot::Bot::Brain; +$Teapot::Bot::Brain::VERSION = '0.021'; # ABSTRACT: A base class to make your very own Telegram bot @@ -14,7 +14,7 @@ use Carp qw/croak/; use Log::Any; use Data::Dumper; -use Telegram::Bot::Object::Message; +use Teapot::Bot::Object::Message; # base class for building telegram robots with Mojolicious has longpoll_time => 60; @@ -82,7 +82,7 @@ sub getMe { my $url = "https://api.telegram.org/bot${token}/getMe"; my $api_response = $self->_post_request($url); - return Telegram::Bot::Object::User->create_from_hash($api_response, $self); + return Teapot::Bot::Object::User->create_from_hash($api_response, $self); } @@ -107,10 +107,10 @@ sub sendMessage { if (exists $args->{reply_markup}) { my $reply_markup = $args->{reply_markup}; die "bad reply_markup supplied" - if ( ref($reply_markup) ne 'Telegram::Bot::Object::InlineKeyboardMarkup' && - ref($reply_markup) ne 'Telegram::Bot::Object::ReplyKeyboardMarkup' && - ref($reply_markup) ne 'Telegram::Bot::Object::ReplyKeyboardRemove' && - ref($reply_markup) ne 'Telegram::Bot::Object::ForceReply' ); + if ( ref($reply_markup) ne 'Teapot::Bot::Object::InlineKeyboardMarkup' && + ref($reply_markup) ne 'Teapot::Bot::Object::ReplyKeyboardMarkup' && + ref($reply_markup) ne 'Teapot::Bot::Object::ReplyKeyboardRemove' && + ref($reply_markup) ne 'Teapot::Bot::Object::ForceReply' ); $send_args->{reply_markup} = $reply_markup; } @@ -118,7 +118,7 @@ sub sendMessage { my $url = "https://api.telegram.org/bot${token}/sendMessage"; my $api_response = $self->_post_request($url, $send_args); - return Telegram::Bot::Object::Message->create_from_hash($api_response, $self); + return Teapot::Bot::Object::Message->create_from_hash($api_response, $self); } @@ -142,7 +142,7 @@ sub forwardMessage { my $url = "https://api.telegram.org/bot${token}/forwardMessage"; my $api_response = $self->_post_request($url, $send_args); - return Telegram::Bot::Object::Message->create_from_hash($api_response, $self); + return Teapot::Bot::Object::Message->create_from_hash($api_response, $self); } @@ -170,7 +170,7 @@ sub sendPhoto { my $url = "https://api.telegram.org/bot${token}/sendPhoto"; my $api_response = $self->_post_request($url, $send_args); - return Telegram::Bot::Object::Message->create_from_hash($api_response, $self); + return Teapot::Bot::Object::Message->create_from_hash($api_response, $self); } @@ -212,10 +212,10 @@ sub _process_message { # There can be several types of responses. But only one response. # https://core.telegram.org/bots/api#update my $update; - $update = Telegram::Bot::Object::Message->create_from_hash($item->{message}, $self) if $item->{message}; - $update = Telegram::Bot::Object::Message->create_from_hash($item->{edited_message}, $self) if $item->{edited_message}; - $update = Telegram::Bot::Object::Message->create_from_hash($item->{channel_post}, $self) if $item->{channel_post}; - $update = Telegram::Bot::Object::Message->create_from_hash($item->{edited_channel_post}, $self) if $item->{edited_channel_post}; + $update = Teapot::Bot::Object::Message->create_from_hash($item->{message}, $self) if $item->{message}; + $update = Teapot::Bot::Object::Message->create_from_hash($item->{edited_message}, $self) if $item->{edited_message}; + $update = Teapot::Bot::Object::Message->create_from_hash($item->{channel_post}, $self) if $item->{channel_post}; + $update = Teapot::Bot::Object::Message->create_from_hash($item->{edited_channel_post}, $self) if $item->{edited_channel_post}; # if we got to this point without creating a response, it must be a type we # don't handle yet @@ -252,7 +252,7 @@ __END__ =head1 NAME -Telegram::Bot::Brain - A base class to make your very own Telegram bot +Teapot::Bot::Brain - A base class to make your very own Telegram bot =head1 VERSION @@ -262,7 +262,7 @@ version 0.021 package MyApp::Coolbot; - use Mojo::Base 'Telegram::Bot::Brain'; + use Mojo::Base 'Teapot::Bot::Brain'; has token => 'token-you-got-from-@botfather'; @@ -306,13 +306,13 @@ This method will add a sub to run every C<$seconds> seconds. Pass this method two parameters, the number of seconds between executions, and the coderef to execute. -Your coderef will be passed the L object when it is +Your coderef will be passed the L object when it is executed. =head2 add_listener Respond to messages we receive. It takes a single argument, a coderef to execute -for each update that is sent to us. These are *typically* C +for each update that is sent to us. These are *typically* C objects, though that is not the only type of update that may be sent (see L). @@ -333,26 +333,26 @@ is already running). This is the wrapper around the C API method. See L. -Takes no arguments, and returns the L that +Takes no arguments, and returns the L that represents this bot. =head2 sendMessage See L. -Returns a L object. +Returns a L object. =head2 forwardMessage See L. -Returns a L object. +Returns a L object. =head2 sendPhoto See L. -Returns a L object. +Returns a L object. =head1 SEE ALSO @@ -376,7 +376,7 @@ updates. L -They all return immediately with the corresponding Telegram::Bot::Object +They all return immediately with the corresponding Teapot::Bot::Object subclass - consult the documenation for each below to see what to expect. Note that not all methods have yet been implemented. diff --git a/lib/Telegram/Bot/Object/Animation.pm b/lib/Teapot/Bot/Object/Animation.pm similarity index 66% rename from lib/Telegram/Bot/Object/Animation.pm rename to lib/Teapot/Bot/Object/Animation.pm index ed3a625..0774fc1 100644 --- a/lib/Telegram/Bot/Object/Animation.pm +++ b/lib/Teapot/Bot/Object/Animation.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::Animation; -$Telegram::Bot::Object::Animation::VERSION = '0.021'; +package Teapot::Bot::Object::Animation; +$Teapot::Bot::Object::Animation::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'Animation' type. -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::PhotoSize; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::PhotoSize; use Carp qw/croak/; has 'file_id'; @@ -18,7 +18,7 @@ has 'file_size'; sub fields { return { scalar => [qw/file_id width height duration file_name mime_type file_size/], - 'Telegram::Bot::Object::PhotoSize' => [qw/thumb/], + 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/], }; } @@ -33,7 +33,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Animation - The base class for Telegram message 'Animation' type. +Teapot::Bot::Object::Animation - The base class for Telegram message 'Animation' type. =head1 VERSION @@ -42,7 +42,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Audio.pm b/lib/Teapot/Bot/Object/Audio.pm similarity index 68% rename from lib/Telegram/Bot/Object/Audio.pm rename to lib/Teapot/Bot/Object/Audio.pm index 0e31238..fa6cb3c 100644 --- a/lib/Telegram/Bot/Object/Audio.pm +++ b/lib/Teapot/Bot/Object/Audio.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::Audio; -$Telegram::Bot::Object::Audio::VERSION = '0.021'; +package Teapot::Bot::Object::Audio; +$Teapot::Bot::Object::Audio::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Audio' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'file_id'; has 'duration'; @@ -15,7 +15,7 @@ has 'thumb'; #PhotoSize sub fields { return { scalar => [qw/file_id duration performer title mime_type file_size/], - 'Telegram::Bot::Object::PhotoSize' => [qw/thumb/], + 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/], }; } @@ -29,7 +29,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Audio - The base class for Telegram 'Audio' type objects +Teapot::Bot::Object::Audio - The base class for Telegram 'Audio' type objects =head1 VERSION @@ -38,7 +38,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Base.pm b/lib/Teapot/Bot/Object/Base.pm similarity index 93% rename from lib/Telegram/Bot/Object/Base.pm rename to lib/Teapot/Bot/Object/Base.pm index 503e7f0..ed95e99 100644 --- a/lib/Telegram/Bot/Object/Base.pm +++ b/lib/Teapot/Bot/Object/Base.pm @@ -1,6 +1,6 @@ -package Telegram::Bot::Object::Base; -$Telegram::Bot::Object::Base::VERSION = '0.021'; -# ABSTRACT: The base class for all Telegram::Bot::Object objects. +package Teapot::Bot::Object::Base; +$Teapot::Bot::Object::Base::VERSION = '0.021'; +# ABSTRACT: The base class for all Teapot::Bot::Object objects. use Mojo::Base -base; @@ -129,7 +129,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Base - The base class for all Telegram::Bot::Object objects. +Teapot::Bot::Object::Base - The base class for all Telegram::Bot::Object objects. =head1 VERSION @@ -139,9 +139,9 @@ version 0.021 This class should not be instantiated itself. Instead, instantiate a sub-class. -You should generally not need to instantiate objects of sub-classes of L, +You should generally not need to instantiate objects of sub-classes of L, instead the appropriate objects will be created from an incoming request via -L. +L. You can then use the methods referenced below on those objects. diff --git a/lib/Telegram/Bot/Object/CallbackGame.pm b/lib/Teapot/Bot/Object/CallbackGame.pm similarity index 68% rename from lib/Telegram/Bot/Object/CallbackGame.pm rename to lib/Teapot/Bot/Object/CallbackGame.pm index f9eddd1..f30331a 100644 --- a/lib/Telegram/Bot/Object/CallbackGame.pm +++ b/lib/Teapot/Bot/Object/CallbackGame.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::CallbackGame; -$Telegram::Bot::Object::CallbackGame::VERSION = '0.021'; +package Teapot::Bot::Object::CallbackGame; +$Teapot::Bot::Object::CallbackGame::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'CallbackGame' type. -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; # https://core.telegram.org/bots/api#callbackgame # "A placeholder, currently holds no information. Use BotFather to set up your game" @@ -22,7 +22,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::CallbackGame - The base class for Telegram message 'CallbackGame' type. +Teapot::Bot::Object::CallbackGame - The base class for Telegram message 'CallbackGame' type. =head1 VERSION @@ -31,7 +31,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Chat.pm b/lib/Teapot/Bot/Object/Chat.pm similarity index 74% rename from lib/Telegram/Bot/Object/Chat.pm rename to lib/Teapot/Bot/Object/Chat.pm index d894c6e..37f0a10 100644 --- a/lib/Telegram/Bot/Object/Chat.pm +++ b/lib/Teapot/Bot/Object/Chat.pm @@ -1,11 +1,11 @@ -package Telegram::Bot::Object::Chat; -$Telegram::Bot::Object::Chat::VERSION = '0.021'; +package Teapot::Bot::Object::Chat; +$Teapot::Bot::Object::Chat::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Chat' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::ChatPhoto; -use Telegram::Bot::Object::Message; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::ChatPhoto; +use Teapot::Bot::Object::Message; has 'id'; has 'type'; @@ -27,8 +27,8 @@ sub fields { last_name all_members_are_administrators description invite_link sticker_set_name can_set_sticker_set/], - 'Telegram::Bot::Object::ChatPhoto' => [qw/photo/], - 'Telegram::Bot::Object::Message' => [qw/pinned_message/], + 'Teapot::Bot::Object::ChatPhoto' => [qw/photo/], + 'Teapot::Bot::Object::Message' => [qw/pinned_message/], }; } @@ -52,7 +52,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Chat - The base class for Telegram 'Chat' type objects +Teapot::Bot::Object::Chat - The base class for Telegram 'Chat' type objects =head1 VERSION @@ -61,7 +61,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 METHODS diff --git a/lib/Telegram/Bot/Object/ChatPhoto.pm b/lib/Teapot/Bot/Object/ChatPhoto.pm similarity index 68% rename from lib/Telegram/Bot/Object/ChatPhoto.pm rename to lib/Teapot/Bot/Object/ChatPhoto.pm index e4bb2ae..46f8e41 100644 --- a/lib/Telegram/Bot/Object/ChatPhoto.pm +++ b/lib/Teapot/Bot/Object/ChatPhoto.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::ChatPhoto; -$Telegram::Bot::Object::ChatPhoto::VERSION = '0.021'; +package Teapot::Bot::Object::ChatPhoto; +$Teapot::Bot::Object::ChatPhoto::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'ChatPhoto' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'small_file_id'; has 'big_file_id'; @@ -24,7 +24,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::ChatPhoto - The base class for Telegram 'ChatPhoto' type objects +Teapot::Bot::Object::ChatPhoto - The base class for Telegram 'ChatPhoto' type objects =head1 VERSION @@ -33,7 +33,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Contact.pm b/lib/Teapot/Bot/Object/Contact.pm similarity index 70% rename from lib/Telegram/Bot/Object/Contact.pm rename to lib/Teapot/Bot/Object/Contact.pm index 444d97e..58cd6b1 100644 --- a/lib/Telegram/Bot/Object/Contact.pm +++ b/lib/Teapot/Bot/Object/Contact.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::Contact; -$Telegram::Bot::Object::Contact::VERSION = '0.021'; +package Teapot::Bot::Object::Contact; +$Teapot::Bot::Object::Contact::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Contact' objects. -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'phone_number'; has 'first_name'; @@ -25,7 +25,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Contact - The base class for Telegram 'Contact' objects. +Teapot::Bot::Object::Contact - The base class for Telegram 'Contact' objects. =head1 VERSION @@ -34,7 +34,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Document.pm b/lib/Teapot/Bot/Object/Document.pm similarity index 64% rename from lib/Telegram/Bot/Object/Document.pm rename to lib/Teapot/Bot/Object/Document.pm index 505ff5e..78beb37 100644 --- a/lib/Telegram/Bot/Object/Document.pm +++ b/lib/Teapot/Bot/Object/Document.pm @@ -1,11 +1,11 @@ -package Telegram::Bot::Object::Document; -$Telegram::Bot::Object::Document::VERSION = '0.021'; +package Teapot::Bot::Object::Document; +$Teapot::Bot::Object::Document::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Document' objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; -use Telegram::Bot::Object::PhotoSize; +use Teapot::Bot::Object::PhotoSize; has 'file_id'; has 'thumb'; #PhotoSize @@ -15,7 +15,7 @@ has 'file_size'; sub fields { return { scalar => [qw/file_id file_name mime_type file_size/], - 'Telegram::Bot::Object::PhotoSize' => [qw/thumb/] + 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/] }; } @@ -29,7 +29,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Document - The base class for Telegram 'Document' objects +Teapot::Bot::Object::Document - The base class for Telegram 'Document' objects =head1 VERSION @@ -38,7 +38,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/EncryptedCredentials.pm b/lib/Teapot/Bot/Object/EncryptedCredentials.pm similarity index 64% rename from lib/Telegram/Bot/Object/EncryptedCredentials.pm rename to lib/Teapot/Bot/Object/EncryptedCredentials.pm index c2425d8..1a78440 100644 --- a/lib/Telegram/Bot/Object/EncryptedCredentials.pm +++ b/lib/Teapot/Bot/Object/EncryptedCredentials.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::EncryptedCredentials; -$Telegram::Bot::Object::EncryptedCredentials::VERSION = '0.021'; +package Teapot::Bot::Object::EncryptedCredentials; +$Teapot::Bot::Object::EncryptedCredentials::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'EncryptedCredentials' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'data'; has 'hash'; @@ -23,7 +23,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::EncryptedCredentials - The base class for Telegram 'EncryptedCredentials' type objects +Teapot::Bot::Object::EncryptedCredentials - The base class for Telegram 'EncryptedCredentials' type objects =head1 VERSION @@ -32,7 +32,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/EncryptedPassportElement.pm b/lib/Teapot/Bot/Object/EncryptedPassportElement.pm similarity index 69% rename from lib/Telegram/Bot/Object/EncryptedPassportElement.pm rename to lib/Teapot/Bot/Object/EncryptedPassportElement.pm index 5eac539..560fa00 100644 --- a/lib/Telegram/Bot/Object/EncryptedPassportElement.pm +++ b/lib/Teapot/Bot/Object/EncryptedPassportElement.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::EncryptedPassportElement; -$Telegram::Bot::Object::EncryptedPassportElement::VERSION = '0.021'; +package Teapot::Bot::Object::EncryptedPassportElement; +$Teapot::Bot::Object::EncryptedPassportElement::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'EncryptedPassportElement' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; # XXX Implement rest of this # https://core.telegram.org/bots/api#encryptedpassportelement @@ -29,7 +29,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::EncryptedPassportElement - The base class for Telegram 'EncryptedPassportElement' type objects +Teapot::Bot::Object::EncryptedPassportElement - The base class for Telegram 'EncryptedPassportElement' type objects =head1 VERSION @@ -38,7 +38,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. Note that this type is not yet fully implemented. diff --git a/lib/Telegram/Bot/Object/Game.pm b/lib/Teapot/Bot/Object/Game.pm similarity index 57% rename from lib/Telegram/Bot/Object/Game.pm rename to lib/Teapot/Bot/Object/Game.pm index 0a99e9d..b27574c 100644 --- a/lib/Telegram/Bot/Object/Game.pm +++ b/lib/Teapot/Bot/Object/Game.pm @@ -1,12 +1,12 @@ -package Telegram::Bot::Object::Game; -$Telegram::Bot::Object::Game::VERSION = '0.021'; +package Teapot::Bot::Object::Game; +$Teapot::Bot::Object::Game::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'Game' type. -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::PhotoSize; -use Telegram::Bot::Object::Animation; -use Telegram::Bot::Object::MessageEntity; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::PhotoSize; +use Teapot::Bot::Object::Animation; +use Teapot::Bot::Object::MessageEntity; has 'title'; has 'description'; @@ -17,9 +17,9 @@ has 'animation'; #Animation sub fields { return { scalar => [qw/title description text/], - 'Telegram::Bot::Object::PhotoSize' => [qw/photo/], - 'Telegram::Bot::Object::MessageEntity' => [qw/text_entities/], - 'Telegram::Bot::Object::Animation' => [qw/animation/], + 'Teapot::Bot::Object::PhotoSize' => [qw/photo/], + 'Teapot::Bot::Object::MessageEntity' => [qw/text_entities/], + 'Teapot::Bot::Object::Animation' => [qw/animation/], }; } @@ -35,7 +35,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Game - The base class for Telegram message 'Game' type. +Teapot::Bot::Object::Game - The base class for Telegram message 'Game' type. =head1 VERSION @@ -44,7 +44,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/InlineKeyboardButton.pm b/lib/Teapot/Bot/Object/InlineKeyboardButton.pm similarity index 63% rename from lib/Telegram/Bot/Object/InlineKeyboardButton.pm rename to lib/Teapot/Bot/Object/InlineKeyboardButton.pm index 6f02559..97d9f31 100644 --- a/lib/Telegram/Bot/Object/InlineKeyboardButton.pm +++ b/lib/Teapot/Bot/Object/InlineKeyboardButton.pm @@ -1,11 +1,11 @@ -package Telegram::Bot::Object::InlineKeyboardButton; -$Telegram::Bot::Object::InlineKeyboardButton::VERSION = '0.021'; +package Teapot::Bot::Object::InlineKeyboardButton; +$Teapot::Bot::Object::InlineKeyboardButton::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'InlineKeyboardButton' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::LoginUrl; -use Telegram::Bot::Object::CallbackGame; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::LoginUrl; +use Teapot::Bot::Object::CallbackGame; has 'text'; has 'url'; @@ -20,8 +20,8 @@ sub fields { return { 'scalar' => [qw/text url callback_data switch_inline_query switch_inline_query_current_chat switch_inline_query_current_chat pay/], - 'Telegram::Bot::Object::LoginUrl' => [qw/login_url/], - 'Telegram::Bot::Object::CallbackGame'=> [qw/callback_game/], + 'Teapot::Bot::Object::LoginUrl' => [qw/login_url/], + 'Teapot::Bot::Object::CallbackGame'=> [qw/callback_game/], }; } @@ -35,7 +35,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::InlineKeyboardButton - The base class for Telegram 'InlineKeyboardButton' type objects +Teapot::Bot::Object::InlineKeyboardButton - The base class for Telegram 'InlineKeyboardButton' type objects =head1 VERSION @@ -44,7 +44,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/InlineKeyboardMarkup.pm b/lib/Teapot/Bot/Object/InlineKeyboardMarkup.pm similarity index 57% rename from lib/Telegram/Bot/Object/InlineKeyboardMarkup.pm rename to lib/Teapot/Bot/Object/InlineKeyboardMarkup.pm index 03e4c87..d02dc7e 100644 --- a/lib/Telegram/Bot/Object/InlineKeyboardMarkup.pm +++ b/lib/Teapot/Bot/Object/InlineKeyboardMarkup.pm @@ -1,15 +1,15 @@ -package Telegram::Bot::Object::InlineKeyboardMarkup; -$Telegram::Bot::Object::InlineKeyboardMarkup::VERSION = '0.021'; +package Teapot::Bot::Object::InlineKeyboardMarkup; +$Teapot::Bot::Object::InlineKeyboardMarkup::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'InlineKeyboardMarkup' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::InlineKeyboardButton; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::InlineKeyboardButton; has 'inline_keyboard'; sub fields { - return { 'Telegram::Bot::Object::InlineKeyboardButton' => [qw/inline_keyboard/], + return { 'Teapot::Bot::Object::InlineKeyboardButton' => [qw/inline_keyboard/], }; } @@ -27,7 +27,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::InlineKeyboardMarkup - The base class for Telegram 'InlineKeyboardMarkup' type objects +Teapot::Bot::Object::InlineKeyboardMarkup - The base class for Telegram 'InlineKeyboardMarkup' type objects =head1 VERSION @@ -36,7 +36,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Invoice.pm b/lib/Teapot/Bot/Object/Invoice.pm similarity index 71% rename from lib/Telegram/Bot/Object/Invoice.pm rename to lib/Teapot/Bot/Object/Invoice.pm index c90de67..a185014 100644 --- a/lib/Telegram/Bot/Object/Invoice.pm +++ b/lib/Teapot/Bot/Object/Invoice.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::Invoice; -$Telegram::Bot::Object::Invoice::VERSION = '0.021'; +package Teapot::Bot::Object::Invoice; +$Teapot::Bot::Object::Invoice::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Invoice' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'title'; has 'description'; @@ -26,7 +26,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Invoice - The base class for Telegram 'Invoice' type objects +Teapot::Bot::Object::Invoice - The base class for Telegram 'Invoice' type objects =head1 VERSION @@ -35,7 +35,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Location.pm b/lib/Teapot/Bot/Object/Location.pm similarity index 68% rename from lib/Telegram/Bot/Object/Location.pm rename to lib/Teapot/Bot/Object/Location.pm index 4799290..a2334fb 100644 --- a/lib/Telegram/Bot/Object/Location.pm +++ b/lib/Teapot/Bot/Object/Location.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::Location; -$Telegram::Bot::Object::Location::VERSION = '0.021'; +package Teapot::Bot::Object::Location; +$Teapot::Bot::Object::Location::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'Location' type. -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'longitude'; has 'latitude'; @@ -23,7 +23,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Location - The base class for Telegram message 'Location' type. +Teapot::Bot::Object::Location - The base class for Telegram message 'Location' type. =head1 VERSION @@ -32,7 +32,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/LoginUrl.pm b/lib/Teapot/Bot/Object/LoginUrl.pm similarity index 70% rename from lib/Telegram/Bot/Object/LoginUrl.pm rename to lib/Teapot/Bot/Object/LoginUrl.pm index a498dad..275c670 100644 --- a/lib/Telegram/Bot/Object/LoginUrl.pm +++ b/lib/Teapot/Bot/Object/LoginUrl.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::LoginUrl; -$Telegram::Bot::Object::LoginUrl::VERSION = '0.021'; +package Teapot::Bot::Object::LoginUrl; +$Teapot::Bot::Object::LoginUrl::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'LoginUrl' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'url'; has 'forward_text'; @@ -24,7 +24,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::LoginUrl - The base class for Telegram 'LoginUrl' type objects +Teapot::Bot::Object::LoginUrl - The base class for Telegram 'LoginUrl' type objects =head1 VERSION @@ -33,7 +33,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Message.pm b/lib/Teapot/Bot/Object/Message.pm similarity index 51% rename from lib/Telegram/Bot/Object/Message.pm rename to lib/Teapot/Bot/Object/Message.pm index 9fe3d10..e958ea0 100644 --- a/lib/Telegram/Bot/Object/Message.pm +++ b/lib/Teapot/Bot/Object/Message.pm @@ -1,32 +1,32 @@ -package Telegram::Bot::Object::Message; -$Telegram::Bot::Object::Message::VERSION = '0.021'; +package Teapot::Bot::Object::Message; +$Teapot::Bot::Object::Message::VERSION = '0.021'; # ABSTRACT: The base class for the Telegram type "Message". -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; -use Telegram::Bot::Object::User; -use Telegram::Bot::Object::Chat; -use Telegram::Bot::Object::MessageEntity; -use Telegram::Bot::Object::Audio; -use Telegram::Bot::Object::Document; -use Telegram::Bot::Object::Animation; -use Telegram::Bot::Object::Game; -use Telegram::Bot::Object::PhotoSize; -use Telegram::Bot::Object::Sticker; -use Telegram::Bot::Object::Video; -use Telegram::Bot::Object::Voice; -use Telegram::Bot::Object::VideoNote; -use Telegram::Bot::Object::Contact; -use Telegram::Bot::Object::Location; -use Telegram::Bot::Object::Poll; -use Telegram::Bot::Object::Location; -use Telegram::Bot::Object::PhotoSize; -use Telegram::Bot::Object::Invoice; -use Telegram::Bot::Object::Venue; -use Telegram::Bot::Object::SuccessfulPayment; -use Telegram::Bot::Object::PassportData; -use Telegram::Bot::Object::InlineKeyboardMarkup; +use Teapot::Bot::Object::User; +use Teapot::Bot::Object::Chat; +use Teapot::Bot::Object::MessageEntity; +use Teapot::Bot::Object::Audio; +use Teapot::Bot::Object::Document; +use Teapot::Bot::Object::Animation; +use Teapot::Bot::Object::Game; +use Teapot::Bot::Object::PhotoSize; +use Teapot::Bot::Object::Sticker; +use Teapot::Bot::Object::Video; +use Teapot::Bot::Object::Voice; +use Teapot::Bot::Object::VideoNote; +use Teapot::Bot::Object::Contact; +use Teapot::Bot::Object::Location; +use Teapot::Bot::Object::Poll; +use Teapot::Bot::Object::Location; +use Teapot::Bot::Object::PhotoSize; +use Teapot::Bot::Object::Invoice; +use Teapot::Bot::Object::Venue; +use Teapot::Bot::Object::SuccessfulPayment; +use Teapot::Bot::Object::PassportData; +use Teapot::Bot::Object::InlineKeyboardMarkup; use Data::Dumper; @@ -93,32 +93,32 @@ sub fields { group_chat_created supergroup_chat_created channel_chat_created migrate_to_chat_id migrate_from_chat_id connected_website/], - 'Telegram::Bot::Object::User' => [qw/from forward_from new_chat_members left_chat_member /], + 'Teapot::Bot::Object::User' => [qw/from forward_from new_chat_members left_chat_member /], - 'Telegram::Bot::Object::Chat' => [qw/chat forward_from_chat/], - 'Telegram::Bot::Object::Message' => [qw/reply_to_message pinned_message/], - 'Telegram::Bot::Object::MessageEntity' => [qw/entities caption_entities /], + 'Teapot::Bot::Object::Chat' => [qw/chat forward_from_chat/], + 'Teapot::Bot::Object::Message' => [qw/reply_to_message pinned_message/], + 'Teapot::Bot::Object::MessageEntity' => [qw/entities caption_entities /], - 'Telegram::Bot::Object::Audio' => [qw/audio/], - 'Telegram::Bot::Object::Document' => [qw/document/], - 'Telegram::Bot::Object::Animation' => [qw/animation/], - 'Telegram::Bot::Object::Game' => [qw/game/], - 'Telegram::Bot::Object::PhotoSize' => [qw/photo new_chat_photo/], - 'Telegram::Bot::Object::Sticker' => [qw/sticker/], - 'Telegram::Bot::Object::Video' => [qw/video/], - 'Telegram::Bot::Object::Voice' => [qw/voice/], - 'Telegram::Bot::Object::VideoNote' => [qw/video_note/], + 'Teapot::Bot::Object::Audio' => [qw/audio/], + 'Teapot::Bot::Object::Document' => [qw/document/], + 'Teapot::Bot::Object::Animation' => [qw/animation/], + 'Teapot::Bot::Object::Game' => [qw/game/], + 'Teapot::Bot::Object::PhotoSize' => [qw/photo new_chat_photo/], + 'Teapot::Bot::Object::Sticker' => [qw/sticker/], + 'Teapot::Bot::Object::Video' => [qw/video/], + 'Teapot::Bot::Object::Voice' => [qw/voice/], + 'Teapot::Bot::Object::VideoNote' => [qw/video_note/], - 'Telegram::Bot::Object::Contact' => [qw/contact/], - 'Telegram::Bot::Object::Location' => [qw/location/], - 'Telegram::Bot::Object::Venue' => [qw/venue/], + 'Teapot::Bot::Object::Contact' => [qw/contact/], + 'Teapot::Bot::Object::Location' => [qw/location/], + 'Teapot::Bot::Object::Venue' => [qw/venue/], - 'Telegram::Bot::Object::Poll' => [qw/poll/], + 'Teapot::Bot::Object::Poll' => [qw/poll/], - 'Telegram::Bot::Object::Invoice' => [qw/invoice/], - 'Telegram::Bot::Object::SuccessfulPayment' => [qw/successful_payment/], - 'Telegram::Bot::Object::PassportData' => [qw/passport_data/], - 'Telegram::Bot::Object::InlineKeyboardMarkup' => [qw/reply_markup/], + 'Teapot::Bot::Object::Invoice' => [qw/invoice/], + 'Teapot::Bot::Object::SuccessfulPayment' => [qw/successful_payment/], + 'Teapot::Bot::Object::PassportData' => [qw/passport_data/], + 'Teapot::Bot::Object::InlineKeyboardMarkup' => [qw/reply_markup/], }; } @@ -144,7 +144,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Message - The base class for the Telegram type "Message". +Teapot::Bot::Object::Message - The base class for the Telegram type "Message". =head1 VERSION @@ -153,7 +153,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 METHODS @@ -161,7 +161,7 @@ attributes available for L objects. A convenience method to reply to a message with text. -Will return the L object representing the message +Will return the L object representing the message sent. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/MessageEntity.pm b/lib/Teapot/Bot/Object/MessageEntity.pm similarity index 63% rename from lib/Telegram/Bot/Object/MessageEntity.pm rename to lib/Teapot/Bot/Object/MessageEntity.pm index a3c3979..6da30b6 100644 --- a/lib/Telegram/Bot/Object/MessageEntity.pm +++ b/lib/Teapot/Bot/Object/MessageEntity.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::MessageEntity; -$Telegram::Bot::Object::MessageEntity::VERSION = '0.021'; +package Teapot::Bot::Object::MessageEntity; +$Teapot::Bot::Object::MessageEntity::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'MessageEntity' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::User; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::User; has 'type'; has 'offset'; @@ -15,7 +15,7 @@ has 'user'; #User sub fields { return { 'scalar' => [qw/type offset length url/], - 'Telegram::Bot::Object::User' => [qw/user/], + 'Teapot::Bot::Object::User' => [qw/user/], }; } @@ -29,7 +29,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::MessageEntity - The base class for Telegram 'MessageEntity' type objects +Teapot::Bot::Object::MessageEntity - The base class for Telegram 'MessageEntity' type objects =head1 VERSION @@ -38,7 +38,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/PassportData.pm b/lib/Teapot/Bot/Object/PassportData.pm similarity index 53% rename from lib/Telegram/Bot/Object/PassportData.pm rename to lib/Teapot/Bot/Object/PassportData.pm index be76af6..88c4e9a 100644 --- a/lib/Telegram/Bot/Object/PassportData.pm +++ b/lib/Teapot/Bot/Object/PassportData.pm @@ -1,18 +1,18 @@ -package Telegram::Bot::Object::PassportData; -$Telegram::Bot::Object::PassportData::VERSION = '0.021'; +package Teapot::Bot::Object::PassportData; +$Teapot::Bot::Object::PassportData::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'PassportData' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::EncryptedPassportElement; -use Telegram::Bot::Object::EncryptedCredentials; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::EncryptedPassportElement; +use Teapot::Bot::Object::EncryptedCredentials; has 'data'; # Array of EncryptedPassportElement has 'credentials'; # EncryptedCredentials sub fields { - return { 'Telegram::Bot::Object::EncryptedPassportElement' => [qw/data/], - 'Telegram::Bot::Object::EncryptedCredentials' => [qw/credentials/], + return { 'Teapot::Bot::Object::EncryptedPassportElement' => [qw/data/], + 'Teapot::Bot::Object::EncryptedCredentials' => [qw/credentials/], }; } sub arrays { @@ -29,7 +29,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::PassportData - The base class for Telegram 'PassportData' type objects +Teapot::Bot::Object::PassportData - The base class for Telegram 'PassportData' type objects =head1 VERSION @@ -38,7 +38,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/PhotoSize.pm b/lib/Teapot/Bot/Object/PhotoSize.pm similarity index 69% rename from lib/Telegram/Bot/Object/PhotoSize.pm rename to lib/Teapot/Bot/Object/PhotoSize.pm index 12af197..7435fd2 100644 --- a/lib/Telegram/Bot/Object/PhotoSize.pm +++ b/lib/Teapot/Bot/Object/PhotoSize.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::PhotoSize; -$Telegram::Bot::Object::PhotoSize::VERSION = '0.021'; +package Teapot::Bot::Object::PhotoSize; +$Teapot::Bot::Object::PhotoSize::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'PhotoSize' type. -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; use Carp qw/croak/; has 'file_id'; @@ -26,7 +26,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::PhotoSize - The base class for Telegram message 'PhotoSize' type. +Teapot::Bot::Object::PhotoSize - The base class for Telegram message 'PhotoSize' type. =head1 VERSION @@ -35,7 +35,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Poll.pm b/lib/Teapot/Bot/Object/Poll.pm similarity index 65% rename from lib/Telegram/Bot/Object/Poll.pm rename to lib/Teapot/Bot/Object/Poll.pm index 13f0489..eade28f 100644 --- a/lib/Telegram/Bot/Object/Poll.pm +++ b/lib/Teapot/Bot/Object/Poll.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::Poll; -$Telegram::Bot::Object::Poll::VERSION = '0.021'; +package Teapot::Bot::Object::Poll; +$Teapot::Bot::Object::Poll::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Poll' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::PollOption; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::PollOption; has 'id'; @@ -14,7 +14,7 @@ has 'is_closed'; sub fields { return { scalar => [qw/id question is_closed/], - 'Telegram::Bot::Object::PollOption' => [qw/options /], + 'Teapot::Bot::Object::PollOption' => [qw/options /], }; } @@ -33,7 +33,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Poll - The base class for Telegram 'Poll' type objects +Teapot::Bot::Object::Poll - The base class for Telegram 'Poll' type objects =head1 VERSION @@ -42,7 +42,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/PollOption.pm b/lib/Teapot/Bot/Object/PollOption.pm similarity index 67% rename from lib/Telegram/Bot/Object/PollOption.pm rename to lib/Teapot/Bot/Object/PollOption.pm index 347b537..a9df01c 100644 --- a/lib/Telegram/Bot/Object/PollOption.pm +++ b/lib/Teapot/Bot/Object/PollOption.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::PollOption; -$Telegram::Bot::Object::PollOption::VERSION = '0.021'; +package Teapot::Bot::Object::PollOption; +$Teapot::Bot::Object::PollOption::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'PollOption' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'text'; has 'voter_count'; @@ -23,7 +23,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::PollOption - The base class for Telegram 'PollOption' type objects +Teapot::Bot::Object::PollOption - The base class for Telegram 'PollOption' type objects =head1 VERSION @@ -32,7 +32,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Sticker.pm b/lib/Teapot/Bot/Object/Sticker.pm similarity index 68% rename from lib/Telegram/Bot/Object/Sticker.pm rename to lib/Teapot/Bot/Object/Sticker.pm index 12d3e23..3005e28 100644 --- a/lib/Telegram/Bot/Object/Sticker.pm +++ b/lib/Teapot/Bot/Object/Sticker.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::Sticker; -$Telegram::Bot::Object::Sticker::VERSION = '0.021'; +package Teapot::Bot::Object::Sticker; +$Teapot::Bot::Object::Sticker::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'Sticker' type. -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::PhotoSize; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::PhotoSize; has 'file_id'; has 'width'; @@ -18,7 +18,7 @@ has 'file_size'; sub fields { return { scalar => [qw/file_id width height emoji set_name file_size /], - 'Telegram::Bot::Object::PhotoSize' => [ qw/thumb/ ], + 'Teapot::Bot::Object::PhotoSize' => [ qw/thumb/ ], }; } @@ -32,7 +32,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Sticker - The base class for Telegram message 'Sticker' type. +Teapot::Bot::Object::Sticker - The base class for Telegram message 'Sticker' type. =head1 VERSION @@ -41,7 +41,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/SuccessfulPayment.pm b/lib/Teapot/Bot/Object/SuccessfulPayment.pm similarity index 67% rename from lib/Telegram/Bot/Object/SuccessfulPayment.pm rename to lib/Teapot/Bot/Object/SuccessfulPayment.pm index f637908..3aa4d1b 100644 --- a/lib/Telegram/Bot/Object/SuccessfulPayment.pm +++ b/lib/Teapot/Bot/Object/SuccessfulPayment.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::SuccessfulPayment; -$Telegram::Bot::Object::SuccessfulPayment::VERSION = '0.021'; +package Teapot::Bot::Object::SuccessfulPayment; +$Teapot::Bot::Object::SuccessfulPayment::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'SuccessfulPayment' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -# use Telegram::Bot::Object::OrderInfo; +use Mojo::Base 'Teapot::Bot::Object::Base'; +# use Teapot::Bot::Object::OrderInfo; has 'currency'; has 'total_amount'; @@ -17,7 +17,7 @@ has 'provider_payment_charge_id'; sub fields { return { scalar => [qw/currency total_amount invoice_payload shipping_option_id telegram_payment_charge_id provider_payment_charge_id/], - # 'Telegram::Bot::Object::OrderInfo' => [qw/order_info/], + # 'Teapot::Bot::Object::OrderInfo' => [qw/order_info/], }; } @@ -32,7 +32,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::SuccessfulPayment - The base class for Telegram 'SuccessfulPayment' type objects +Teapot::Bot::Object::SuccessfulPayment - The base class for Telegram 'SuccessfulPayment' type objects =head1 VERSION @@ -41,7 +41,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/User.pm b/lib/Teapot/Bot/Object/User.pm similarity index 73% rename from lib/Telegram/Bot/Object/User.pm rename to lib/Teapot/Bot/Object/User.pm index 78dfe4f..d0b9304 100644 --- a/lib/Telegram/Bot/Object/User.pm +++ b/lib/Teapot/Bot/Object/User.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::User; -$Telegram::Bot::Object::User::VERSION = '0.021'; +package Teapot::Bot::Object::User; +$Teapot::Bot::Object::User::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'User' type. -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'id'; has 'is_bot'; @@ -27,7 +27,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::User - The base class for Telegram message 'User' type. +Teapot::Bot::Object::User - The base class for Telegram message 'User' type. =head1 VERSION @@ -36,7 +36,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Venue.pm b/lib/Teapot/Bot/Object/Venue.pm similarity index 67% rename from lib/Telegram/Bot/Object/Venue.pm rename to lib/Teapot/Bot/Object/Venue.pm index 369e2b7..08130da 100644 --- a/lib/Telegram/Bot/Object/Venue.pm +++ b/lib/Teapot/Bot/Object/Venue.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::Venue; -$Telegram::Bot::Object::Venue::VERSION = '0.021'; +package Teapot::Bot::Object::Venue; +$Teapot::Bot::Object::Venue::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'LoginUrl' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::Location; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::Location; has 'location'; #Location has 'title'; @@ -15,7 +15,7 @@ has 'foursquare_type'; sub fields { return { 'scalar' => [qw/title address foursquare_id foursquare_type/], - 'Telegram::Bot::Object::Location' => [qw/location/] }; + 'Teapot::Bot::Object::Location' => [qw/location/] }; } @@ -29,7 +29,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Venue - The base class for Telegram 'LoginUrl' type objects +Teapot::Bot::Object::Venue - The base class for Telegram 'LoginUrl' type objects =head1 VERSION @@ -38,7 +38,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Video.pm b/lib/Teapot/Bot/Object/Video.pm similarity index 68% rename from lib/Telegram/Bot/Object/Video.pm rename to lib/Teapot/Bot/Object/Video.pm index 891db9b..a34e2e1 100644 --- a/lib/Telegram/Bot/Object/Video.pm +++ b/lib/Teapot/Bot/Object/Video.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::Video; -$Telegram::Bot::Object::Video::VERSION = '0.021'; +package Teapot::Bot::Object::Video; +$Teapot::Bot::Object::Video::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Video' object. -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::PhotoSize; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::PhotoSize; has 'file_id'; has 'width'; @@ -17,7 +17,7 @@ has 'file_size'; sub fields { return { scalar => [qw/file_id width height duration mime_type file_size /], - 'Telegram::Bot::Object::PhotoSize' => [qw/thumb/] + 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/] }; } @@ -31,7 +31,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Video - The base class for Telegram 'Video' object. +Teapot::Bot::Object::Video - The base class for Telegram 'Video' object. =head1 VERSION @@ -40,7 +40,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/VideoNote.pm b/lib/Teapot/Bot/Object/VideoNote.pm similarity index 65% rename from lib/Telegram/Bot/Object/VideoNote.pm rename to lib/Teapot/Bot/Object/VideoNote.pm index acd31c6..7c90e86 100644 --- a/lib/Telegram/Bot/Object/VideoNote.pm +++ b/lib/Teapot/Bot/Object/VideoNote.pm @@ -1,10 +1,10 @@ -package Telegram::Bot::Object::VideoNote; -$Telegram::Bot::Object::VideoNote::VERSION = '0.021'; +package Teapot::Bot::Object::VideoNote; +$Teapot::Bot::Object::VideoNote::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'VideoNote' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; -use Telegram::Bot::Object::PhotoSize; +use Mojo::Base 'Teapot::Bot::Object::Base'; +use Teapot::Bot::Object::PhotoSize; has 'file_id'; has 'length'; @@ -15,7 +15,7 @@ has 'file_size'; sub fields { return { scalar => [qw/file_id length duration mime_type file_size/], - 'Telegram::Bot::Object::PhotoSize' => [qw/thumb /], + 'Teapot::Bot::Object::PhotoSize' => [qw/thumb /], }; } @@ -30,7 +30,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::VideoNote - The base class for Telegram 'VideoNote' type objects +Teapot::Bot::Object::VideoNote - The base class for Telegram 'VideoNote' type objects =head1 VERSION @@ -39,7 +39,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/Telegram/Bot/Object/Voice.pm b/lib/Teapot/Bot/Object/Voice.pm similarity index 70% rename from lib/Telegram/Bot/Object/Voice.pm rename to lib/Teapot/Bot/Object/Voice.pm index f56fc10..50f5997 100644 --- a/lib/Telegram/Bot/Object/Voice.pm +++ b/lib/Teapot/Bot/Object/Voice.pm @@ -1,9 +1,9 @@ -package Telegram::Bot::Object::Voice; -$Telegram::Bot::Object::Voice::VERSION = '0.021'; +package Teapot::Bot::Object::Voice; +$Teapot::Bot::Object::Voice::VERSION = '0.021'; # ABSTRACT: The base class for Telegram 'Voice' type objects -use Mojo::Base 'Telegram::Bot::Object::Base'; +use Mojo::Base 'Teapot::Bot::Object::Base'; has 'file_id'; has 'duration'; @@ -25,7 +25,7 @@ __END__ =head1 NAME -Telegram::Bot::Object::Voice - The base class for Telegram 'Voice' type objects +Teapot::Bot::Object::Voice - The base class for Telegram 'Voice' type objects =head1 VERSION @@ -34,7 +34,7 @@ version 0.021 =head1 DESCRIPTION See L for details of the -attributes available for L objects. +attributes available for L objects. =head1 AUTHOR diff --git a/lib/telegrambot.pm b/lib/telegrambot.pm index 38aae22..47d2a13 100644 --- a/lib/telegrambot.pm +++ b/lib/telegrambot.pm @@ -11,7 +11,7 @@ use open qw(:std :utf8); use File::Path qw( mkpath ); use Hailo; use Encode; -use Mojo::Base 'Telegram::Bot::Brain'; +use Mojo::Base 'Teapot::Bot::Brain'; use conf qw(loadConf); use botlib qw(weather logger trim randomCommonPhrase); @@ -56,7 +56,7 @@ sub __on_msg { $can_talk = 0; unless ($myid) { - my $myObj = Telegram::Bot::Brain::getMe ($self); + my $myObj = Teapot::Bot::Brain::getMe ($self); $myid = $myObj->id; # TODO: use these values instead of pre-defined in config! $myusername = $myObj->username; @@ -172,7 +172,7 @@ sub __on_msg { sleep ( 3 + int ( rand (2))); - Telegram::Bot::Brain::sendMessage ($self, $send_args); + Teapot::Bot::Brain::sendMessage ($self, $send_args); return; } @@ -324,7 +324,7 @@ sub __on_msg { MYHELP $send_args->{parse_mode} = 'Markdown'; $send_args->{chat_id} = $chatid; - Telegram::Bot::Brain::sendMessage ($self, $send_args); + Teapot::Bot::Brain::sendMessage ($self, $send_args); return; } elsif (substr ($text, 1) eq 'ping') { $reply = 'Pong.'; diff --git a/lib/telegramlib.pm b/lib/telegramlib.pm index 5279304..2ee0d7e 100644 --- a/lib/telegramlib.pm +++ b/lib/telegramlib.pm @@ -1,5 +1,5 @@ package telegramlib; -# store here functions that are not implemented in Telegram::Bot +# store here functions that are not implemented in Teapot::Bot use 5.018; use strict; @@ -8,7 +8,7 @@ use utf8; use open qw(:std :utf8); use botlib qw(trim); -use Telegram::Bot::Brain; +use Teapot::Bot::Brain; # module shit use vars qw/$VERSION/; @@ -32,7 +32,7 @@ sub getChat { # framework does just omits it, when creating object from hash, so # pick raw json object instead - #return Telegram::Bot::Object::User->create_from_hash($api_response, $self); + #return Teapot::Bot::Object::User->create_from_hash($api_response, $self); return $api_response; } @@ -48,7 +48,7 @@ sub getChatMember { my $url = "https://api.telegram.org/bot${token}/getChatMember"; my $api_response = $self->_post_request ($url, $send_args); - # return Telegram::Bot::Object::User->create_from_hash($api_response, $self); + # return Teapot::Bot::Object::User->create_from_hash($api_response, $self); return $api_response; } @@ -65,7 +65,7 @@ sub sendChatAction { my $url = "https://api.telegram.org/bot${token}/sendChatAction"; my $api_response = $self->_post_request ($url, $send_args); - # return Telegram::Bot::Object::User->create_from_hash($api_response, $self); + # return Teapot::Bot::Object::User->create_from_hash($api_response, $self); return; }