public Task <IResult> Execute(Message msg, BotUser user)
 {
     return(Task.FromResult <IResult>(new SuccessfulResult
     {
         Message = "Выберите действие:",
         Keyboard = DefaultKeyboards.GetMailingKeyboard(user)
     }));
 }
Beispiel #2
0
    private async Task <IResult> SetWeatherMailing(BotUser user, bool isWeather)
    {
        if (string.IsNullOrWhiteSpace(user.WeatherCity))
        {
            return(new FailedResult(DefaultErrors.CityNotSet));
        }

        user.SetHasWeather(!isWeather);
        await _db.SaveChangesAsync();

        return(new SuccessfulResult
        {
            Message = Success,
            Keyboard = DefaultKeyboards.GetMailingKeyboard(user)
        });
    }
Beispiel #3
0
    private async Task <IResult> SetScheduleMailing(BotUser user, bool isSchedule)
    {
        if (user.NarfuGroup == 0)
        {
            return(new FailedResult(DefaultErrors.GroupNotSet));
        }

        user.SetHasSchedule(!isSchedule);
        await _db.SaveChangesAsync();

        return(new SuccessfulResult
        {
            Message = Success,
            Keyboard = DefaultKeyboards.GetMailingKeyboard(user)
        });
    }