Skip to content

Instantly share code, notes, and snippets.

@ledlamp
Last active Aug 22, 2019
Embed
What would you like to do?
discord.io data collector
var fs = require("fs");
fs.appendFileSync("discord.ws.log", "\n\n\n");
var Discord = require("discord.io");
var client = new Discord.Client({
token: require("../config").token,
autorun: true,
messageCacheLimit: 0
});
client.setPresence({status: "invisible"});
client.on("any", msg => {
fs.appendFileSync("discord.ws.log", `${Date.now()} ${JSON.stringify(msg)}\n`);
});
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"cjopus": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/cjopus/-/cjopus-0.0.4.tgz",
"integrity": "sha1-RvPPyWuD99eERt6LTP2ZS1iJqaA="
},
"discord.io": {
"version": "github:izy521/discord.io#1b17c8617d402b48b86ca5dbde4121b8ffc7e0e4",
"from": "github:izy521/discord.io",
"requires": {
"cjopus": "^0.0.4",
"tweetnacl": "^0.14.0",
"ws": "^1.1.0"
}
},
"options": {
"version": "0.0.6",
"resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz",
"integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8="
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q="
},
"ultron": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz",
"integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po="
},
"ws": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/ws/-/ws-1.1.5.tgz",
"integrity": "sha512-o3KqipXNUdS7wpQzBHSe180lBGO60SoK0yVo3CYJgb2MkobuWuBX6dhkYP5ORCLd55y+SaflMOV5fqAB53ux4w==",
"requires": {
"options": ">=0.0.5",
"ultron": "1.0.x"
}
}
}
}
{
"dependencies": {
"discord.io": "github:izy521/discord.io"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment