Telegram/InlineKeyboardButton.pm

filter: Statementstmt 47.0% 8 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 25.0% 3 / 12 Podpod 100% 8 / 8 totaltotal 51.3% 19 / 37 SCAR 1.4
CC
1
Cov
47%
callback_data
2.0
callback_game
2.0
login_url
2.0
CRAP 1.1
« Telegram/ChatPermissions.pm ↑ Summary Telegram/InputMediaVideo.pm »
1 # -*- perl -*-
2 ##----------------------------------------------------------------------------
3 ## Net/API/Telegram/InlineKeyboardButton.pm
4 ## Version 0.1
5 ## Copyright(c) 2019 Jacques Deguest
6 ## Author: Jacques Deguest <jack@deguest.jp>
7 ## Created 2019/05/29
8 ## Modified 2020/05/20
9 ## All rights reserved.
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package Net::API::Telegram::InlineKeyboardButton;
15 BEGIN
16 {
17 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶ use parent qw( Net::API::Telegram::Generic );
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ our( $VERSION ) = '0.1';
Subroutine BEGIN: called CC=1 SCAR=0.0
20 };
21  
22 0 ▶sub callback_data { return( shift->_set_get_scalar( 'callback_data', @_ ) ); }
Subroutine callback_data: not called CC=1 SCAR=6.9
Pod documented
23  
24 0 ▶sub callback_game { return( shift->_set_get_object( 'callback_game', 'Net::API::Telegram::CallbackGame', @_ ) ); }
Subroutine callback_game: not called CC=1 SCAR=6.9
Pod documented
25  
26 0 ▶sub login_url { return( shift->_set_get_object( 'login_url', 'Net::API::Telegram::LoginUrl', @_ ) ); }
Subroutine login_url: not called CC=1 SCAR=6.9
Pod documented
27  
28 0 ▶sub pay { return( shift->_set_get_scalar( 'pay', @_ ) ); }
Subroutine pay: not called CC=1 SCAR=6.9
Pod documented
29  
30 0 ▶sub switch_inline_query { return( shift->_set_get_scalar( 'switch_inline_query', @_ ) ); }
Subroutine switch_inline_query: not called CC=1 SCAR=6.9
Pod documented
31  
32 0 ▶sub switch_inline_query_current_chat { return( shift->_set_get_scalar( 'switch_inline_query_current_chat', @_ ) ); }
Subroutine switch_inline_query_current_chat: not called CC=1 SCAR=6.9
Pod documented
33  
34 0 ▶sub text { return( shift->_set_get_scalar( 'text', @_ ) ); }
Subroutine text: not called CC=1 SCAR=6.9
Pod documented
35  
36 0 ▶sub url { return( shift->_set_get_scalar( 'url', @_ ) ); }
Subroutine url: not called CC=1 SCAR=6.9
Pod documented
37  
38 0 ▶sub _is_boolean { return( grep( /^$_[1]$/, qw( pay ) ) ); }
Subroutine _is_boolean: not called CC=1 SCAR=6.9
39  
40 1 1;
41  
42 __END__
43  
44 =encoding utf-8
45  
46 =head1 NAME
47  
48 Net::API::Telegram::InlineKeyboardButton - One button of an inline keyboard
49  
50 =head1 SYNOPSIS
51  
52 my $msg = Net::API::Telegram::InlineKeyboardButton->new( %data ) ||
53 die( Net::API::Telegram::InlineKeyboardButton->error, "\n" );
54  
55 =head1 DESCRIPTION
56  
57 L<Net::API::Telegram::InlineKeyboardButton> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#inlinekeyboardbutton>
58  
59 This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl.
60  
61 =head1 METHODS
62  
63 =over 4
64  
65 =item B<new>( {INIT HASH REF}, %PARAMETERS )
66  
67 B<new>() will create a new object for the package, pass any argument it might receive
68 to the special standard routine B<init> that I<must> exist.
69 Then it returns what returns B<init>().
70  
71 The valid parameters are as follow. Methods available here are also parameters to the B<new> method.
72  
73 =over 8
74  
75 =item * I<verbose>
76  
77 =item * I<debug>
78  
79 =back
80  
81 =item B<callback_data>( String )
82  
83 Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
84  
85 =item B<callback_game>( L<Net::API::Telegram::CallbackGame> )
86  
87 Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row.
88  
89 =item B<login_url>( L<Net::API::Telegram::LoginUrl> )
90  
91 Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
92  
93 =item B<pay>( Boolean )
94  
95 Optional. Specify True, to send a Pay button.NOTE: This type of button must always be the first button in the first row.
96  
97 =item B<switch_inline_query>( String )
98  
99 Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted.Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
100  
101 =item B<switch_inline_query_current_chat>( String )
102  
103 Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted.This offers a quick way for the user to open your bot in inline mode in the same chat – good for selecting something from multiple options.
104  
105 =item B<text>( String )
106  
107 Label text on the button
108  
109 =item B<url>( String )
110  
111 Optional. HTTP or tg:// url to be opened when button is pressed
112  
113 =back
114  
115 =head1 COPYRIGHT
116  
117 Copyright (c) 2000-2019 DEGUEST Pte. Ltd.
118  
119 =head1 AUTHOR
120  
121 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
122  
123 =head1 SEE ALSO
124  
125 L<Net::API::Telegram>
126  
127 =head1 COPYRIGHT & LICENSE
128  
129 Copyright (c) 2018-2019 DEGUEST Pte. Ltd.
130  
131 You can use, copy, modify and redistribute this package and associated
132 files under the same terms as Perl itself.
133  
134 =cut
135  
« Telegram/ChatPermissions.pm ↑ Summary Telegram/InputMediaVideo.pm »