line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- perl -*- |
2
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
## Net/API/Telegram/ReplyKeyboardMarkup.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::ReplyKeyboardMarkup; |
15
|
|
|
|
|
|
|
BEGIN |
16
|
|
|
|
|
|
|
{ |
17
|
1
|
|
|
1
|
|
854
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
18
|
1
|
|
|
1
|
|
5
|
use parent qw( Net::API::Telegram::Generic ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
19
|
1
|
|
|
1
|
|
172
|
our( $VERSION ) = '0.1'; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
1
|
|
sub keyboard { return( shift->_set_get_object_array2( 'keyboard', 'Net::API::Telegram::KeyboardButton', @_ ) ); } |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
0
|
1
|
|
sub one_time_keyboard { return( shift->_set_get_scalar( 'one_time_keyboard', @_ ) ); } |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
|
sub resize_keyboard { return( shift->_set_get_scalar( 'resize_keyboard', @_ ) ); } |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
1
|
|
sub selective { return( shift->_set_get_scalar( 'selective', @_ ) ); } |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
|
|
sub _is_boolean { return( grep( /^$_[1]$/, qw( one_time_keyboard resize_keyboard selective ) ) ); } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=encoding utf-8 |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Net::API::Telegram::ReplyKeyboardMarkup - A custom keyboard with reply options (see Introduction to bots for details and examples) |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
my $msg = Net::API::Telegram::ReplyKeyboardMarkup->new( %data ) || |
45
|
|
|
|
|
|
|
die( Net::API::Telegram::ReplyKeyboardMarkup->error, "\n" ); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 DESCRIPTION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
L<Net::API::Telegram::ReplyKeyboardMarkup> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#replykeyboardmarkup> |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 METHODS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=over 4 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=item B<new>( {INIT HASH REF}, %PARAMETERS ) |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
B<new>() will create a new object for the package, pass any argument it might receive |
60
|
|
|
|
|
|
|
to the special standard routine B<init> that I<must> exist. |
61
|
|
|
|
|
|
|
Then it returns what returns B<init>(). |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The valid parameters are as follow. Methods available here are also parameters to the B<new> method. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=over 8 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item * I<verbose> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item * I<debug> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=back |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item B<keyboard>( Array of Array of KeyboardButton ) |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Array of button rows, each represented by an Array of KeyboardButton objects |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item B<one_time_keyboard>( Boolean ) |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat â the user can press a special button in the input field to see the custom keyboard again. Defaults to false. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item B<resize_keyboard>( Boolean ) |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item B<selective>( Boolean ) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.Example: A user requests to change the botâs language, bot replies to the request with a keyboard to select the new language. Other users in the group donât see the keyboard. |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=back |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 COPYRIGHT |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Copyright (c) 2000-2019 DEGUEST Pte. Ltd. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head1 AUTHOR |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 SEE ALSO |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
L<Net::API::Telegram> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Copyright (c) 2018-2019 DEGUEST Pte. Ltd. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
108
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
|