From 4d92d34f5b67220e4fa32562e080e6a0bf0aa2e1 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 12 May 2020 02:00:19 -0500 Subject: [PATCH] agagagagga --- package.json | 2 +- src/index.js | 24 +++--------------------- src/rewrite.js | 31 +++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 src/rewrite.js diff --git a/package.json b/package.json index 9d0f498..d9e59ea 100644 --- a/package.json +++ b/package.json @@ -21,5 +21,5 @@ "bugs": { "url": "https://github.com/Technicolor-creamsicle/Osselbot/issues" }, - "homepage": "https://github.com/Technicolor-creamsicle/Osselbot#readme" + "homepage": "https://technicolor.2a03.party/bot" } diff --git a/src/index.js b/src/index.js index 87b8289..1c1a2ce 100755 --- a/src/index.js +++ b/src/index.js @@ -1,11 +1,4 @@ -#!/usr/bin/env node -// Load up the discord.js library -const Discord = require("discord.js"); -const prettyMilliseconds = require('pretty-ms'); -// This is your client. Some people call it `bot`, some people call it `self`, -// some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`, -// this is what we're refering to. Your client. -const client = new Discord.Client(); + // Here we load the config.json file that contains our token and our prefix values. const config = require("./config.json"); @@ -13,18 +6,7 @@ const config = require("./config.json"); // config.prefix contains the message prefix. //Activity setting -client.on("ready", () => { - // This event will run if the bot starts, and logs in, successfully. - console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`); - // Example of changing the bot's playing game to something useful. `client.user` is what the - // docs refer to as the "ClientUser". - client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' }); -}); -client.on("guildCreate", guild => { - // This event triggers when the bot joins a guild. - console.log(`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`); - client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' }); -}); + client.on('guildMemberAdd', member => { console.log(`New member joined: ${member.name} (id: ${member.id}).`); client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' }); @@ -365,7 +347,7 @@ client.on("message", async message => { client.destroy(); process.exit(69); } - if (message.author.id === '258325046869622785' || '216042720047661057') { + if (message.author.id === '216042720047661057') { message.reply("**Authenticated**, Restarting now."); client.user.setActivity(`Itself die`,{ type: 'WATCHING' }); setTimeout(shutdown, 5000, 'shutdown'); diff --git a/src/rewrite.js b/src/rewrite.js new file mode 100644 index 0000000..c660c73 --- /dev/null +++ b/src/rewrite.js @@ -0,0 +1,31 @@ +#!/usr/bin/env node +// Load up the libraries +const Discord = require("discord.js"); +const prettyMilliseconds = require('pretty-ms'); +const config = require("./config.json"); +// This is the client +const client = new Discord.Client(); +client.on("ready", () => { + // This event will run if the bot starts, and logs in, successfully. + console.log(`Bot has started, with ${client.users.cache.size} users, in ${client.channels.cache.size} channels of ${client.guilds.cache.size} guilds.`); + // Example of changing the bot's playing game to something useful. `client.user` is what the + // docs refer to as the "ClientUser". + client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' }); +}); +//Updates people count +client.on('guildMemberAdd', member => { + console.log(`New member joined: ${member.name} (id: ${member.id}).`); + client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' }); +}); +client.on('guildMemberRemove', member => { + console.log(` member left: ${member.name} (id: ${member.id}).`); + client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' }); +}); +////// ACTUAL MESSAGE PROCESSING + + + + + +//Logging in the bot +client.login(config.token)