public string Reply(SimpleMessage message) { //string userId = message.Id; //UserProfile userProfile = GetProfile(userId); //userProfile.AccessCount++; //SetProfile(userId, userProfile); return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { string userId = message.Identification; var profile = GetProfile(userId); long contador = profile.Contador + 1; profile.Contador = contador; SetProfile(userId, profile); return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { var cliente = new MongoClient("mongodb://localhost:27017"); var db = cliente.GetDatabase("chatbot"); var col = db.GetCollection <BsonDocument>("log"); col.InsertOne(new BsonDocument() { { "user", message.User }, { "message", message.Text } }); return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { var cliente = new MongoClient(); var db = cliente.GetDatabase("Bot"); var col = db.GetCollection <BsonDocument>("Messages"); var doc = new BsonDocument { { "User", message.User }, { "Message", message.Text } }; col.InsertOne(doc); return($"{message.User}: {message.Text}"); }
public string Reply(SimpleMessage message) { BsonDocument document = new BsonDocument() { { "id", Environment.MachineName }, { "nome", message.User }, { "mensagem", message.Text } }; Connection.GravarLogAcesso(Environment.MachineName); Connection.Insert(document); return($"{message.User} disse '{message.Text}"); }
public static void inserirMensagem(Logic.SimpleMessage mensagem) { string connection = "mongodb://localhost:27017"; MongoClient cl = new MongoClient(connection); var db = cl.GetDatabase("BOT"); var col = db.GetCollection <BsonDocument>("historicoMensagens"); BsonDocument doc = new BsonDocument() { { "fromName", mensagem.User }, { "fromId", mensagem.Id }, { "mensagem", mensagem.Text } }; col.InsertOne(doc); }
private void SaveMessage(SimpleMessage message) { var client = new MongoClient(); var db = client.GetDatabase("dbBot"); var col = db.GetCollection <BsonDocument>("MessageSend"); var doc = new BsonDocument() { { "UserName", message.User }, { "TextMessage", message.Text } }; col.InsertOne(doc); }
public string Reply(SimpleMessage message) { _messageRepository.Save(new Model.Message(message.User, message.Text)); var userCounter = _userCounterRepository.Get(message.User); if (userCounter == null) { _userCounterRepository.Save(new Model.UserCounter(message.User)); } else { _userCounterRepository.UpdateCounter(userCounter); } return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { var cliente = new MongoClient("mongodb://localhost"); var db = cliente.GetDatabase("cliente"); var col = db.GetCollection <BsonDocument>("cliente"); var ret = message.Id; var dado = message.Text; var txt = message.User; var doc = new BsonDocument() { { "campo1", ret }, { "campo2", dado }, { "campo3", txt } }; col.InsertOne(doc); return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { SaveMessage(message.Text).Wait(); return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { controleMensagens.controleDeEnvio(message.Id); return($"{message.User} disse '{message.Text}"); }
public string Reply(SimpleMessage message) { var usrId = message.Id; return($"{message.User} disse '{message.Text}"); }