public TelegramHookProcessService(TelegramBotClient telegramBotClient,
                                          JobBotDbContext ctx)
        {
            _telegramBotClient = telegramBotClient;

            _ctx = ctx;
        }
示例#2
0
        public async Task Reply(TelegramBotClient client, Update hook, JobBotDbContext ctx = null)
        {
            var user = await ctx.Users.FirstOrDefaultAsync(x => x.ChatId == hook.ChatId());

            user.SearchEnabled = true;

            ctx.Users.Update(user);

            await ctx.SaveChangesAsync();
        }
示例#3
0
 public async Task Reply(TelegramBotClient client, Update hook, JobBotDbContext ctx = null)
 {
     var inlineKeyboard = new InlineKeyboardMarkup(new[]
     {
         new[]
         {
             InlineKeyboardButton.WithCallbackData("Home"),
         }
     });;
     await client.SendTextMessageAsync(hook.ChatId(), "To setup preferences tap /update <fill with lang>", replyMarkup : inlineKeyboard);
 }
        public async Task Reply(TelegramBotClient client, Update hook, JobBotDbContext ctx = null)
        {
            var user = await ctx.Users.FirstOrDefaultAsync(x => x.ChatId == hook.ChatId());

            var preferences = hook.Message.Text.TrimStart(UpdatePreferencesCommand.ToCharArray()).Trim();

            user.Preferences = preferences;

            ctx.Users.Update(user);
            await ctx.SaveChangesAsync();

            await client.SendTextMessageAsync(hook.ChatId(), "preferences changed to " + preferences);
        }
 public async Task Reply(TelegramBotClient client, Update hook, JobBotDbContext ctx = null)
 {
     var inlineKeyboard = new InlineKeyboardMarkup(new[]
     {
         new []
         {
             InlineKeyboardButton.WithCallbackData(CallbackData.Settings.Text),
             InlineKeyboardButton.WithCallbackData(CallbackData.About.Text),
         },
     });
     await client.SendTextMessageAsync(
         hook.ChatId(), "Hello it't job scrapper foundation bot", replyMarkup : inlineKeyboard);
 }
示例#6
0
 public async Task Reply(TelegramBotClient client, Update hook, JobBotDbContext ctx = null)
 {
     var inlineKeyboard = new InlineKeyboardMarkup(new[]
     {
         new []
         {
             InlineKeyboardButton.WithCallbackData("Preferences"),
             InlineKeyboardButton.WithCallbackData("Notifications"),
         },
         new[]
         {
             InlineKeyboardButton.WithCallbackData("Home"),
         }
     });;
     await client.SendTextMessageAsync(hook.ChatId(), "its settings", replyMarkup : inlineKeyboard);
 }
 public async Task Reply(TelegramBotClient client, Update hook, JobBotDbContext ctx = null)
 {
     var inlineKeyboard = new InlineKeyboardMarkup(new[]
     {
         new []
         {
             InlineKeyboardButton.WithCallbackData("On", "Notification:On"),
             InlineKeyboardButton.WithCallbackData("Off", "Notification:Off"),
         },
         new[]
         {
             InlineKeyboardButton.WithCallbackData("Home"),
         }
     });
     await client.SendTextMessageAsync(hook.ChatId(), "Here you can manage notifications settings , turn-off or turn-on", replyMarkup : inlineKeyboard);
 }
 public async Task Reply(TelegramBotClient client, Update hook, JobBotDbContext ctx = null)
 {
     var inlineKeyboard = new InlineKeyboardMarkup(new[]
     {
         new []
         {
             InlineKeyboardButton.WithUrl("Github", Consts.Consts.GithubURL)
         },
         new[]
         {
             InlineKeyboardButton.WithCallbackData("Home"),
         }
     });
     await client.SendPhotoAsync(hook.ChatId(),
                                 photo : Consts.Consts.LogoURL,
                                 caption : string.Join("\n", "What is job crawler foundation?",
                                                       @"It's open source community on github with main goal to crawl as many as possible job websites with programming job and aggregate them."),
                                 replyMarkup : inlineKeyboard);
 }
 public RegistrationService(JobBotDbContext context)
 {
     _context = context;
 }
 public JobHostedService(JobBotDbContext jobBotDbContext)
 {
     _jobBotDbContext = jobBotDbContext;
 }
 public async Task RegisterUser(JobBotDbContext ctx, Update hook)
 {
 }