line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- perl -*- |
2
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
## Net/API/Telegram/Chat.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::Chat; |
15
|
|
|
|
|
|
|
BEGIN |
16
|
|
|
|
|
|
|
{ |
17
|
1
|
|
|
1
|
|
856
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
18
|
1
|
|
|
1
|
|
4
|
use parent qw( Net::API::Telegram::Generic ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
19
|
1
|
|
|
1
|
|
277
|
our( $VERSION ) = '0.1'; |
20
|
|
|
|
|
|
|
}; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
1
|
|
sub can_set_sticker_set { return( shift->_set_get_scalar( 'can_set_sticker_set', @_ ) ); } |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
0
|
1
|
|
sub description { return( shift->_set_get_scalar( 'description', @_ ) ); } |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
0
|
1
|
|
sub first_name { return( shift->_set_get_scalar( 'first_name', @_ ) ); } |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
1
|
|
sub id { return( shift->_set_get_number( 'id', @_ ) ); } |
29
|
|
|
|
|
|
|
|
30
|
0
|
|
|
0
|
1
|
|
sub invite_link { return( shift->_set_get_scalar( 'invite_link', @_ ) ); } |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
0
|
1
|
|
sub last_name { return( shift->_set_get_scalar( 'last_name', @_ ) ); } |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
0
|
1
|
|
sub permissions { return( shift->_set_get_object( 'permissions', 'Net::API::Telegram::ChatPermissions', @_ ) ); } |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
1
|
|
sub photo { return( shift->_set_get_object( 'photo', 'Net::API::Telegram::ChatPhoto', @_ ) ); } |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
1
|
|
sub pinned_message { return( shift->_set_get_object( 'pinned_message', 'Net::API::Telegram::Message', @_ ) ); } |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
0
|
1
|
|
sub sticker_set_name { return( shift->_set_get_scalar( 'sticker_set_name', @_ ) ); } |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
1
|
|
sub title { return( shift->_set_get_scalar( 'title', @_ ) ); } |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
1
|
|
sub type { return( shift->_set_get_scalar( 'type', @_ ) ); } |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
0
|
1
|
|
sub username { return( shift->_set_get_scalar( 'username', @_ ) ); } |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
0
|
|
|
sub _is_boolean { return( grep( /^$_[1]$/, qw( can_set_sticker_set ) ) ); } |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=encoding utf-8 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 NAME |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Net::API::Telegram::Chat - A chat |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 SYNOPSIS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
my $msg = Net::API::Telegram::Chat->new( %data ) || |
63
|
|
|
|
|
|
|
die( Net::API::Telegram::Chat->error, "\n" ); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 DESCRIPTION |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
L<Net::API::Telegram::Chat> is a Telegram Message Object as defined here L<https://core.telegram.org/bots/api#chat> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This module has been automatically generated from Telegram API documentation by the script scripts/telegram-doc2perl-methods.pl. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 METHODS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=over 4 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item B<new>( {INIT HASH REF}, %PARAMETERS ) |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
B<new>() will create a new object for the package, pass any argument it might receive |
78
|
|
|
|
|
|
|
to the special standard routine B<init> that I<must> exist. |
79
|
|
|
|
|
|
|
Then it returns what returns B<init>(). |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
The valid parameters are as follow. Methods available here are also parameters to the B<new> method. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=over 8 |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item * I<verbose> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item * I<debug> |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=back |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item B<can_set_sticker_set>( Boolean ) |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Optional. True, if the bot can change the group sticker set. Returned only in getChat. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item B<description>( String ) |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=item B<first_name>( String ) |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Optional. First name of the other party in a private chat |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=item B<id>( Integer ) |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=item B<invite_link>( String ) |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=item B<last_name>( String ) |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Optional. Last name of the other party in a private chat |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=item B<permissions>( L<Net::API::Telegram::ChatPermissions> ) |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=item B<photo>( L<Net::API::Telegram::ChatPhoto> ) |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Optional. Chat photo. Returned only in getChat. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item B<pinned_message>( L<Net::API::Telegram::Message> ) |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=item B<sticker_set_name>( String ) |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Optional. For supergroups, name of group sticker set. Returned only in getChat. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=item B<title>( String ) |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Optional. Title, for supergroups, channels and group chats |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=item B<type>( String ) |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Type of chat, can be either I<private>, I<group>, I<supergroup> or I<channel> |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item B<username>( String ) |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Optional. Username, for private chats, supergroups and channels if available |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=back |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
=head1 COPYRIGHT |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
Copyright (c) 2000-2019 DEGUEST Pte. Ltd. |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head1 AUTHOR |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 SEE ALSO |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
L<Net::API::Telegram> |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Copyright (c) 2018-2019 DEGUEST Pte. Ltd. |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
162
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=cut |
165
|
|
|
|
|
|
|
|