Browse Source

Download data on addRoles

master
Abheek Dhawan 4 years ago
parent
commit
00dee1e291
  1. 5
      index.js

5
index.js

@ -3,13 +3,13 @@
const csv = require('csvtojson'); const csv = require('csvtojson');
const Discord = require('discord.js'); const Discord = require('discord.js');
const client = new Discord.Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'] }); const client = new Discord.Client({ partials: ['MESSAGE', 'CHANNEL', 'REACTION'] });
const { execSync } = require("child_process");
client.on("ready", () => { client.on("ready", () => {
console.log("Logged in as " + client.user.tag + "!"); console.log("Logged in as " + client.user.tag + "!");
}); });
client.on("message", message => { client.on("message", async message => {
switch (message.content.toLowerCase()) { switch (message.content.toLowerCase()) {
case '$score': case '$score':
startScoring(message); startScoring(message);
@ -18,6 +18,7 @@ client.on("message", message => {
memberCount(message); memberCount(message);
break; break;
case '$addroles': case '$addroles':
execSync("wget --no-check-certificate --output-document=participants.csv https://docs.google.com/spreadsheets/d/1lufn28YR29OkCS4wH_WQXfCalAgJRi8_r4NCesJSbQY/export\?gid\=2119488170\&format\=csv", { encoding: 'utf-8' });
csv().fromFile('participants.csv') csv().fromFile('participants.csv')
.then(users => { .then(users => {
users.forEach(function (user) { users.forEach(function (user) {

Loading…
Cancel
Save