Opdaterede Mentions i createUserData

This commit is contained in:
Villads Valur Korsholm Nielsen 2016-05-17 11:27:15 +00:00
parent 63cf8e0dfe
commit 9875ed5be3

View File

@ -12,15 +12,15 @@ bot.startRTM(function(err,bot,payload) {
});
function createUserData(id) {
return {id: id, jon_mentions: 0, bot_mentions: 0};
return {id: id, pattern_mentions: 0, bot_mentions: 0};
};
function incrementKey(id, key, amount) {
controller.storage.users.get(id, function(err,user_data) {
if (!user_data) {
console.log("Initializing user data");
user_data = createUserData(id);
}
user_data = createUserData(id);
console.log("Current user data:",user_data);
console.log("Incrementing mentions. Was " + user_data[key] + " will be " + (user_data[key] + amount));
user_data[key] = user_data[key] + amount