all repos — telegram-bot-api @ a687eafa688398901a2328c55a597438d84d175d

Golang bindings for the Telegram Bot API

Add helper methods
OvyFlash olegshva4ko@gmail.com
Sun, 07 Jan 2024 09:37:27 +0200
commit

a687eafa688398901a2328c55a597438d84d175d

parent

9cb877e6953fa0e5a61308a2a979c0defaba2cb7

1 files changed, 43 insertions(+), 0 deletions(-)

jump to
M helper_methods.gohelper_methods.go

@@ -855,6 +855,49 @@ Description: description,

} } +func NewPinChatMessage(chatID int64, messageID int, disableNotification bool) PinChatMessageConfig { + return PinChatMessageConfig{ + BaseChatMessage: BaseChatMessage{ + ChatConfig: ChatConfig{ + ChatID: chatID, + }, + MessageID: messageID, + }, + DisableNotification: disableNotification, + } +} + +func NewUnpinChatMessage(chatID int64, messageID int) UnpinChatMessageConfig { + return UnpinChatMessageConfig{ + BaseChatMessage: BaseChatMessage{ + ChatConfig: ChatConfig{ + ChatID: chatID, + }, + MessageID: messageID, + }, + } +} + +func NewGetChatMember(chatID, userID int64) GetChatMemberConfig { + return GetChatMemberConfig{ + ChatConfigWithUser: ChatConfigWithUser{ + ChatConfig: ChatConfig{ + ChatID: chatID, + }, + UserID: userID, + }, + } +} + +func NewChatMember(chatID, userID int64) ChatMemberConfig { + return ChatMemberConfig{ + ChatConfig: ChatConfig{ + ChatID: chatID, + }, + UserID: userID, + } +} + // NewChatPhoto allows you to update the photo for a chat. func NewChatPhoto(chatID int64, photo RequestFileData) SetChatPhotoConfig { return SetChatPhotoConfig{