Opdaterede Mentions i createUserData
This commit is contained in:
parent
63cf8e0dfe
commit
9875ed5be3
|
@ -12,15 +12,15 @@ bot.startRTM(function(err,bot,payload) {
|
||||||
});
|
});
|
||||||
|
|
||||||
function createUserData(id) {
|
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) {
|
function incrementKey(id, key, amount) {
|
||||||
controller.storage.users.get(id, function(err,user_data) {
|
controller.storage.users.get(id, function(err,user_data) {
|
||||||
if (!user_data) {
|
if (!user_data) {
|
||||||
console.log("Initializing user data");
|
console.log("Initializing user data");
|
||||||
user_data = createUserData(id);
|
|
||||||
}
|
}
|
||||||
|
user_data = createUserData(id);
|
||||||
console.log("Current user data:",user_data);
|
console.log("Current user data:",user_data);
|
||||||
console.log("Incrementing mentions. Was " + user_data[key] + " will be " + (user_data[key] + amount));
|
console.log("Incrementing mentions. Was " + user_data[key] + " will be " + (user_data[key] + amount));
|
||||||
user_data[key] = user_data[key] + amount
|
user_data[key] = user_data[key] + amount
|
||||||
|
|
Loading…
Reference in New Issue
Block a user