示例#1
0
        public async Task EndChat(long chatid)
        {
            if (!await provider.hubService.IsChatActive(chatid))
            {
                await client.SendTextMessageAsync(chatid, "У вас нету активных соеденений");

                await ExceptionMessage.SendExceptionMessage(client, "Возможно ошибка с закрытием диалога");
            }
            long[] chatIds = await provider.hubService.GetChatId(chatid);

            await provider.hubService.StopChat(chatid);

            await client.SendTextMessageAsync(chatid, "Выберите один из вариантов", 0, false, false, 0, KeyBoardHandler.Murkup_Start_AfterChange());

            await client.SendTextMessageAsync(chatIds[0], "Выберите один из вариантов", 0, false, false, 0, KeyBoardHandler.Murkup_Start_AfterChange());
        }
示例#2
0
        public async ValueTask <bool> isAllowedUser(UserDTO user, int privil)
        {
            if (user == null)
            {
                return(false);
            }
            if (user.PilotPrivilag < privil)
            {
                await client.SendTextMessageAsync(user.ChatId, "Вам недоступна данная функция", 0, false, false, 0, KeyBoardHandler.Murkup_Start_AfterChange());

                return(false);
            }
            return(true);
        }