Пример #1
0
        public Task <MessageData> SendMessageAsync(MessageAction type, long chatId, string content,
                                                   Dictionary <string, object> parameters = null)
        {
            if (parameters == null)
            {
                parameters = new Dictionary <string, object>();
            }

            var typeInfo = type.ToKeyValue();

            parameters.Add("chat_id", chatId);
            if (!string.IsNullOrEmpty(typeInfo.Value))
            {
                parameters.Add(typeInfo.Value, content);
            }
            LogMessage($"Message to {chatId} was sent");

            return(SendWebRequest <MessageData>(typeInfo.Key, parameters));
        }