-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(API): Added the following methods:
- unpinAllChatMessages - leaveChat - getChat - getChatAdministrators - getChatMemberCount - getChatMember
- Loading branch information
Showing
9 changed files
with
350 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { IChatMemberAdministrator } from "./IChatMemberAdministrator"; | ||
import { IChatMemberBanned } from "./IChatMemberBanned"; | ||
import { IChatMemberLeft } from "./IChatMemberLeft"; | ||
import { IChatMemberMember } from "./IChatMemberMember"; | ||
import { IChatMemberOwner } from "./IChatMemberOwner"; | ||
import { IChatMemberRestricted } from "./IChatMemberRestricted"; | ||
|
||
export interface IChatMember { | ||
member: IChatMemberAdministrator | IChatMemberBanned | IChatMemberLeft | IChatMemberMember | IChatMemberOwner | IChatMemberRestricted | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { IUser } from "."; | ||
|
||
/** | ||
* Represents a chat member that has some additional privileges. | ||
*/ | ||
export interface IChatMemberAdministrator { | ||
/** | ||
* The member's status in the chat, always "administrator" | ||
*/ | ||
status: string; | ||
/** | ||
* Information about the user | ||
*/ | ||
user: IUser; | ||
/** | ||
* True, if the bot is allowed to edit administrator privileges of that user | ||
*/ | ||
can_be_edited: boolean; | ||
/** | ||
* True, if the user's presence in the chat is hidden | ||
*/ | ||
is_anonymous: boolean; | ||
/** | ||
* 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 | ||
*/ | ||
can_manage_chat: boolean; | ||
/** | ||
* True, if the administrator can delete messages of other users | ||
*/ | ||
can_delete_messages: boolean; | ||
/** | ||
* True, if the administrator can manage voice chats | ||
*/ | ||
can_manage_voice_chats: boolean; | ||
/** | ||
* True, if the administrator can restrict, ban or unban chat members | ||
*/ | ||
can_restrict_members: boolean; | ||
/** | ||
* True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) | ||
*/ | ||
can_promote_members: boolean; | ||
/** | ||
* True, if the user is allowed to change the chat title, photo and other settings | ||
*/ | ||
can_change_info: boolean; | ||
/** | ||
* True, if the user is allowed to invite new users to the chat | ||
*/ | ||
can_invite_users: boolean; | ||
/** | ||
* Optional. True, if the administrator can post in the channel; channels only | ||
*/ | ||
can_post_messages: boolean; | ||
/** | ||
* Optional. True, if the administrator can edit messages of other users and can pin messages; channels only | ||
*/ | ||
can_edit_messages: boolean; | ||
/** | ||
* Optional. True, if the user is allowed to pin messages; groups and supergroups only | ||
*/ | ||
can_pin_messages: boolean; | ||
/** | ||
* Optional. Custom title for this user | ||
*/ | ||
custom_title: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { IUser } from "."; | ||
|
||
/** | ||
* Represents a chat member that was banned in the chat and can't return to the chat or view chat messages. | ||
*/ | ||
|
||
export interface IChatMemberBanned { | ||
/** | ||
* The member's status in the chat, always "kicked" | ||
*/ | ||
status: string; | ||
/** | ||
* Information about the user | ||
*/ | ||
user: IUser; | ||
/** | ||
* Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever | ||
*/ | ||
until_date: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { IUser } from "."; | ||
|
||
/** | ||
* Represents a chat member that isn't currently a member of the chat, but may join it themselves. | ||
*/ | ||
|
||
export interface IChatMemberLeft { | ||
/** | ||
* The member's status in the chat, always "left" | ||
*/ | ||
status: string; | ||
/** | ||
* Information about the user | ||
*/ | ||
user: IUser; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { IUser } from "."; | ||
|
||
/** | ||
* Represents a chat member that has no additional privileges or restrictions. | ||
*/ | ||
|
||
export interface IChatMemberMember { | ||
/** | ||
* The member's status in the chat, always "member" | ||
*/ | ||
status: string; | ||
/** | ||
* Information about the user | ||
*/ | ||
user: IUser; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { IUser } from "."; | ||
|
||
/** | ||
* Represents a chat member that owns the chat and has all administrator privileges. | ||
*/ | ||
|
||
export interface IChatMemberOwner { | ||
/** | ||
* The member's status in the chat, always "creator" | ||
*/ | ||
status: string; | ||
/** | ||
* Information about the user | ||
*/ | ||
user: IUser; | ||
/** | ||
* True, if the user's presence in the chat is hidden | ||
*/ | ||
is_anonymous: boolean; | ||
/** | ||
* Optional. Custom title for this user | ||
*/ | ||
custom_title: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { IUser } from "."; | ||
|
||
/** | ||
* Represents a chat member that is under certain restrictions in the chat. Supergroups only. | ||
*/ | ||
export interface IChatMemberRestricted { | ||
/** | ||
* The member's status in the chat, always "restricted" | ||
*/ | ||
status: string; | ||
/** | ||
* Information about the user | ||
*/ | ||
user: IUser; | ||
/** | ||
* True, if the user is a member of the chat at the moment of the request | ||
*/ | ||
is_member: boolean; | ||
/** | ||
* True, if the user is allowed to change the chat title, photo and other settings | ||
*/ | ||
can_change_info: boolean; | ||
/** | ||
* True, if the user is allowed to invite new users to the chat | ||
*/ | ||
can_invite_users: boolean; | ||
/** | ||
* True, if the user is allowed to pin messages | ||
*/ | ||
can_pin_messages: boolean; | ||
/** | ||
* True, if the user is allowed to send text messages, contacts, locations and venues | ||
*/ | ||
can_send_messages: boolean; | ||
/** | ||
* True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes | ||
*/ | ||
can_send_media_messages: boolean; | ||
/** | ||
* True, if the user is allowed to send polls | ||
*/ | ||
can_send_polls: boolean; | ||
/** | ||
* True, if the user is allowed to send animations, games, stickers and use inline bots | ||
*/ | ||
can_send_other_messages: boolean; | ||
/** | ||
* True, if the user is allowed to add web page previews to their messages | ||
*/ | ||
can_add_web_page_previews: boolean; | ||
/** | ||
* Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever | ||
*/ | ||
until_date: number; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters