예제 #1
0
        private async Task Unsubscribe(string result, long chatId)
        {
            if (string.IsNullOrEmpty(result))
            {
                await _tgService.SendMessage(chatId, Texts.CommandFormatShouldBeNext);
            }
            else
            {
                var group = await _vkService.GetGroupInfo(result);

                if (group == null)
                {
                    await _tgService.SendMessage(chatId, string.Format(Texts.GroupIsNotFound, result));

                    return;
                }
                var unsubscribed = await _dataService.RemoveSubscription(-group.gid, chatId);

                await _tgService.SendMessage(chatId,
                                             unsubscribed
                                             ?string.Format(Texts.YouAreUnsubscribed, result)
                                             : string.Format(Texts.YouAreNotSubscribed, result)
                                             );
            }
        }