Add alias for kickChatMember rename.
parent
0d342c8d5a
commit
f2ef2729ab
15
configs.go
15
configs.go
|
@ -1294,18 +1294,18 @@ func (config UnbanChatMemberConfig) params() (Params, error) {
|
|||
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)
|
||||
|
@ -1316,6 +1316,11 @@ func (config KickChatMemberConfig) params() (Params, error) {
|
|||
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 {
|
||||
ChatMemberConfig
|
||||
|
|
|
@ -281,6 +281,7 @@ func TestFileLink(t *testing.T) {
|
|||
var (
|
||||
_ Chattable = AnimationConfig{}
|
||||
_ Chattable = AudioConfig{}
|
||||
_ Chattable = BanChatMemberConfig{}
|
||||
_ Chattable = CallbackConfig{}
|
||||
_ Chattable = ChatActionConfig{}
|
||||
_ Chattable = ChatAdministratorsConfig{}
|
||||
|
|
Loading…
Reference in New Issue