Пример #1
0
        private void Client_OnMessage(object sender, Telegram.Bot.Args.MessageEventArgs e)
        {
            if (e.Message == null)
            {
                return;
            }
            OnMessage?.Invoke(e.Message.Text);
            Match match = Regex.Match(e.Message.Text, @"^/register (?<key>\w{32})$", RegexOptions.IgnoreCase);

            if (match.Success)
            {
                string key = match.Groups["key"].Value;
                RegisterAcc?.Invoke(key, e.Message.From.Id, e.Message.Chat.Id);
            }
        }