diff --git a/lib/Teapot/Bot/Brain.pm b/lib/Teapot/Bot/Brain.pm index 3377fbc..bfb0feb 100644 --- a/lib/Teapot/Bot/Brain.pm +++ b/lib/Teapot/Bot/Brain.pm @@ -139,20 +139,20 @@ sub getChatMember { } } -sub kickChatMember { +sub banChatMember { my $self = shift; my $args = shift || {}; - my $token = $self->token || croak 'No token supplied to kickChatMember?'; + my $token = $self->token || croak 'No token supplied to banChatMember?'; my $send_args = {}; unless ($args->{chat_id}) { - cluck 'No chat_id supplied to kickChatMember()'; + cluck 'No chat_id supplied to banChatMember()'; return {'error' => 1}; } unless ($args->{user_id}) { - cluck 'No user_id supplied to kickChatMember()'; + cluck 'No user_id supplied to banChatMember()'; return {'error' => 1}; } @@ -161,7 +161,7 @@ sub kickChatMember { $send_args->{until_date} = $args->{until_date} if exists $args->{until_date}; $send_args->{revoke_messages} = $args->{revoke_messages} if exists $args->{revoke_messages}; - my $url = "https://api.telegram.org/bot${token}/kickChatMember"; + my $url = "https://api.telegram.org/bot${token}/banChatMember"; my $api_response = $self->_post_request($url, $send_args); return; @@ -805,10 +805,10 @@ of Chat User. On error returns hash reference with error set to 1 -=head2 kickChatMember +=head2 banChatMember -This is the wrapper around the C API method. See -L. +This is the wrapper around the C API method. See +L. Takes chat_id, and user_id as arguments. And optionally until_date and revoke_messages. diff --git a/lib/Teapot/Bot/Object/ChatMember.pm b/lib/Teapot/Bot/Object/ChatMember.pm index 6399d84..563f3c9 100644 --- a/lib/Teapot/Bot/Object/ChatMember.pm +++ b/lib/Teapot/Bot/Object/ChatMember.pm @@ -7,32 +7,58 @@ use Carp qw(cluck); $Teapot::Bot::Object::ChatMember::VERSION = '0.022'; -has 'user'; -has 'status'; -has 'custom_title'; # optional. Owner and administrators only. -has 'is_anonymous'; # Optional. Owner and administrators only. +# ChatMemberOwner +has 'user'; +has 'status'; +has 'custom_title'; # optional. Owner and administrators only. +has 'is_anonymous'; # Optional. Owner and administrators only. -has 'can_be_edited'; # optional. Administrators only. -has 'can_manage_chat'; # Optional. Administrators only. True, if the administrator can access the chat event +# ChatMemberAdministrator +# has 'user'; +# has 'status'; +has 'can_be_edited'; # optional. Administrators only. +# has 'custom_title'; # optional. Owner and administrators only. +# has 'is_anonymous'; # Optional. Owner and administrators only. +has 'can_manage_chat'; # Optional. Administrators only. True, if the administrator can access the chat event # log, chat statistics, message statistics in channels, see channel members, see # anonymous administrators in supergroups and ignore slow mode. Implied by any other # administrator privilege -has 'can_post_messages'; # optional. Administrators only. -has 'can_edit_messages'; # optional. Administrators only. -has 'can_delete_messages'; # optional. Administrators only. -has 'can_manage_voice_chats'; # Optional. Administrators only. True, if the administrator can manage voice chats -has 'can_restrict_members'; # optional. Administrators only. -has 'can_promote_members'; # optional. Administrators only. -has 'can_change_info'; # optional. Administrators and restricted only. -has 'can_invite_users'; # optional. Administrators and restricted only. -has 'can_pin_messages'; # optional. Administrators and restricted only. -has 'is_member'; # optional. Restricted only. -has 'can_send_messages'; # optional. Restricted only. -has 'can_send_media_messages'; # optional. Restricted only. -has 'can_send_polls'; # optional. Restricted only. -has 'can_send_other_messages'; # optional. Restricted only. -has 'can_add_web_page_previews'; # optional. Restricted only. -has 'until_date'; # optional. Restricted and kicked only. +has 'can_post_messages'; # optional. Administrators only. +has 'can_edit_messages'; # optional. Administrators only. +has 'can_delete_messages'; # optional. Administrators only. +has 'can_manage_voice_chats'; # Optional. Administrators only. True, if the administrator can manage voice chats +has 'can_restrict_members'; # optional. Administrators only. +has 'can_promote_members'; # optional. Administrators only. +has 'can_change_info'; # optional. Administrators and restricted only. +has 'can_invite_users'; # optional. Administrators and restricted only. +has 'can_pin_messages'; # optional. Administrators and restricted only. + +# ChatMemberMember +# has 'status'; +# has 'user'; + +# ChatMemberRestricted +# has 'status'; +# has 'user'; +has 'is_member'; # optional. Restricted only. +# has 'can_change_info'; # optional. Administrators and restricted only. +# has 'can_invite_users'; # optional. Administrators and restricted only. +# has 'can_pin_messages'; # optional. Administrators and restricted only. +has 'can_send_messages'; # optional. Restricted only. +has 'can_send_media_messages'; # optional. Restricted only. +has 'can_send_polls'; # optional. Restricted only. +has 'can_send_other_messages'; # optional. Restricted only. +has 'can_add_web_page_previews'; # optional. Restricted only. +has 'until_date'; # optional. Restricted and kicked only. + +# ChatMemberLeft +# has 'status'; +# has 'user'; + +# ChatMemberBanned +# has 'status'; +# has 'user'; +# has 'until_date'; # optional. Restricted and kicked only. sub fields { return {