Add alias for kickChatMember rename.
Syfaro syfaro@huefox.com
Fri, 03 Dec 2021 21:44:02 -0500
2 files changed,
11 insertions(+),
5 deletions(-)
M
configs.go
→
configs.go
@@ -1294,18 +1294,18 @@
return params, nil } -// KickChatMemberConfig contains extra fields to kick user -type KickChatMemberConfig struct { +// BanChatMemberConfig contains extra fields to kick user. +type BanChatMemberConfig struct { ChatMemberConfig UntilDate int64 RevokeMessages bool } -func (config KickChatMemberConfig) method() string { - return "kickChatMember" +func (config BanChatMemberConfig) method() string { + return "banChatMember" } -func (config KickChatMemberConfig) params() (Params, error) { +func (config BanChatMemberConfig) params() (Params, error) { params := make(Params) params.AddFirstValid("chat_id", config.ChatID, config.SuperGroupUsername)@@ -1315,6 +1315,11 @@ params.AddBool("revoke_messages", config.RevokeMessages)
return params, nil } + +// KickChatMemberConfig contains extra fields to ban user. +// +// This was renamed to BanChatMember in later versions of the Telegram Bot API. +type KickChatMemberConfig = BanChatMemberConfig // RestrictChatMemberConfig contains fields to restrict members of chat type RestrictChatMemberConfig struct {
M
types_test.go
→
types_test.go
@@ -281,6 +281,7 @@ // Ensure all configs are sendable
var ( _ Chattable = AnimationConfig{} _ Chattable = AudioConfig{} + _ Chattable = BanChatMemberConfig{} _ Chattable = CallbackConfig{} _ Chattable = ChatActionConfig{} _ Chattable = ChatAdministratorsConfig{}