Browse Source

???

master
Morgan Bazalgette 4 years ago
parent
commit
8f156220c0
3 changed files with 19 additions and 9 deletions
  1. 10
    0
      db-create.js
  2. 2
    5
      index.js
  3. 7
    4
      package.json

+ 10
- 0
db-create.js View File

@@ -0,0 +1,10 @@
var sqlite3 = require("sqlite3");
var db = new sqlite3.Database('data.db');
db.serialize(function() {
db.run("CREATE TABLE users (id INT NOT NULL, first_name TEXT NOT NULL, "+
"username TEXT, last_tags TEXT, rating TEXT, PRIMARY KEY(id))");
db.run("CREATE TABLE groups (id INT)");
});
db.close();

+ 2
- 5
index.js View File

@@ -16,15 +16,12 @@ if (!String.prototype.format) {
String.prototype.format = function() {
var args = arguments;
return this.replace(/{(\d+)}/g, function(match, number) {
return typeof args[number] != 'undefined'
? args[number]
: match
;
return typeof args[number] !== 'undefined' ? args[number] : match;
});
};
}
Array.prototype.randomElement = function () {
return this[Math.floor(Math.random() * this.length)]
return this[Math.floor(Math.random() * this.length)]
}
var newMember = function(memberName, chatID) {

+ 7
- 4
package.json View File

@@ -8,10 +8,12 @@
"start": "node run.js"
},
"author": "Howl <the@howl.moe>",
"contributors": [{
"name": "Howl",
"email": "the@howl.moe"
}],
"contributors": [
{
"name": "Howl",
"email": "the@howl.moe"
}
],
"repository": {
"type": "git",
"url": "https://github.com/TheHowl/boorugram"
@@ -24,6 +26,7 @@
"forever-monitor": "^1.6.0",
"node-telegram-bot": "^0.1.2",
"request": "^2.61.0",
"sqlite3": "^3.1.0",
"xml2js": "^0.4.12"
}
}

Loading…
Cancel
Save