public async Task <bool> IsMatch(Update update) { BotConfig config = await _configService.LoadAsync(); return(await _messageRule.IsMatch(update) && update.Message.ReplyToMessage?.From.Username == config.SwInfoBot); }
public async Task <bool> IsMatch(Update update) { BotConfig config = await _configService.LoadAsync(); return(await _messageRule.IsMatch(update) && (update.Message.Text.Equals("/ping") || update.Message.Text.Equals($"/ping@{config.Bot}"))); }
public async Task <bool> IsMatch(Update update) { BotConfig botConfig = await _configService.LoadAsync(); return(await _messageRule.IsMatch(update) && botConfig.ChatAdmins.ContainsKey(update.Message.Chat.Id) && botConfig.ChatAdmins[update.Message.Chat.Id].Contains($"@{update.Message.From.Username}") && Regex.IsMatch(update.Message.Text, @"^\/addping[\n\s]+\@\w+([\n\s]+\@\w+)*$")); }
public async Task <bool> IsMatch(Update update) { return(await _messageRule.IsMatch(update) && Regex.IsMatch(update.Message.Text, "^/labmoney.*")); }