mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
AddPeerMember: added new bot-related errors
This commit is contained in:
parent
5675e81f8b
commit
742886534a
@ -4468,3 +4468,6 @@ Any member of this group will be able to see messages in the channel.";
|
||||
"Appearance.TintAllColors" = "Tint All Colors";
|
||||
|
||||
"Contacts.DeselectAll" = "Deselect All";
|
||||
|
||||
"Channel.TooMuchBots" = "Sorry, there are already too many bots in this group. Please remove some of the bots you're not using first.";
|
||||
"Channel.BotDoesntSupportGroups" = "Sorry, this bot is telling us it doesn't want to be added to groups. You can't add this bot unless its developers change their mind.";
|
||||
|
@ -77,6 +77,8 @@ public enum AddChannelMemberError {
|
||||
case limitExceeded
|
||||
case tooMuchJoined
|
||||
case bot(PeerId)
|
||||
case botDoesntSupportGroups
|
||||
case tooMuchBots
|
||||
}
|
||||
|
||||
public func addChannelMember(account: Account, peerId: PeerId, memberId: PeerId) -> Signal<(ChannelParticipant?, RenderedChannelParticipant), AddChannelMemberError> {
|
||||
@ -106,6 +108,10 @@ public func addChannelMember(account: Account, peerId: PeerId, memberId: PeerId)
|
||||
return .fail(.restricted)
|
||||
case "USER_BOT":
|
||||
return .fail(.bot(memberId))
|
||||
case "BOT_GROUPS_BLOCKED":
|
||||
return .fail(.botDoesntSupportGroups)
|
||||
case "BOTS_TOO_MUCH":
|
||||
return .fail(.tooMuchBots)
|
||||
default:
|
||||
return .fail(.generic)
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -409,6 +409,10 @@ public func channelMembersController(context: AccountContext, peerId: PeerId) ->
|
||||
contactsController?.dismiss()
|
||||
})
|
||||
return
|
||||
case .botDoesntSupportGroups:
|
||||
text = presentationData.strings.Channel_BotDoesntSupportGroups
|
||||
case .tooMuchBots:
|
||||
text = presentationData.strings.Channel_TooMuchBots
|
||||
}
|
||||
presentControllerImpl?(textAlertController(context: context, title: nil, text: text, actions: [TextAlertAction(type: .defaultAction, title: presentationData.strings.Common_OK, action: {})]), nil)
|
||||
contactsController?.dismiss()
|
||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user