Added spoofed tokebot profile and nameplate, made registering as tokebot impossible.
This commit is contained in:
parent
1d3906247a
commit
58b6d18f26
6 changed files with 111 additions and 22 deletions
|
|
@ -37,6 +37,11 @@ const statSchema = new mongoose.Schema({
|
|||
required: true,
|
||||
default: 0
|
||||
},
|
||||
firstLaunch: {
|
||||
type: mongoose.SchemaTypes.Date,
|
||||
required: true,
|
||||
default: new Date()
|
||||
},
|
||||
tokes: [{
|
||||
toke: {
|
||||
type: mongoose.SchemaTypes.Map,
|
||||
|
|
@ -83,6 +88,7 @@ statSchema.statics.incrementLaunchCount = async function(){
|
|||
|
||||
//print bootup message to console.
|
||||
console.log(`${config.instanceName}(Powered by Canopy) initialized. This server has booted ${stats.launchCount} time${stats.launchCount == 1 ? '' : 's'}.`)
|
||||
console.log(`First booted on ${stats.firstLaunch}.`);
|
||||
}
|
||||
|
||||
statSchema.statics.incrementUserCount = async function(){
|
||||
|
|
@ -124,4 +130,40 @@ statSchema.statics.tattooToke = async function(toke){
|
|||
await stats.save();
|
||||
}
|
||||
|
||||
statSchema.statics.getTokeCount = async function(){
|
||||
//get stats doc
|
||||
const stats = await this.getStats();
|
||||
|
||||
//return toke count
|
||||
return stats.tokes.length;
|
||||
}
|
||||
|
||||
statSchema.statics.getTokeCommandCounts = async function(){
|
||||
//get stats doc
|
||||
const stats = await this.getStats()
|
||||
//Create empty map to hold toke command counts
|
||||
const count = new Map();
|
||||
|
||||
//for each toke
|
||||
stats.tokes.forEach((toke) => {
|
||||
//For each toke command called in the current toke
|
||||
toke.toke.forEach((command) => {
|
||||
//Get the current count for the current command
|
||||
var curCount = count.get(command);
|
||||
|
||||
//if the current count is null
|
||||
if(curCount == null){
|
||||
//Set it to one
|
||||
count.set(command, 1);
|
||||
}else{
|
||||
//Set it to ++curCount
|
||||
count.set(command, ++curCount);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//return the toke command count
|
||||
return count;
|
||||
}
|
||||
|
||||
module.exports = mongoose.model("statistics", statSchema);
|
||||
Loading…
Add table
Add a link
Reference in a new issue