From 2b98f98b1c60001d136cea7a5b60e085991aab0f Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 18 May 2020 13:51:01 -0500 Subject: [PATCH] 2.0.4 FINAL --- old stuff/shard.js | 5 +---- src/config.json | 2 +- src/index.js | 19 ++++++++++++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/old stuff/shard.js b/old stuff/shard.js index 6cf6bbd..b302327 100644 --- a/old stuff/shard.js +++ b/old stuff/shard.js @@ -1,5 +1,2 @@ -const { ShardingManager } = require('discord.js'); -const manager = new ShardingManager('./bot.js', { token: 'Njc4MDkzNjY4NzcwNTEyOTE3.XkdyyA.6n4wvPmzOw-fwuysEoTPU8Cv2x0' }); -manager.spawn(); -manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`)); +DEPRICATED diff --git a/src/config.json b/src/config.json index ccd34f9..dbf0d1d 100644 --- a/src/config.json +++ b/src/config.json @@ -1,4 +1,4 @@ { "token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU", - "prefix" : ";" + "prefix" : "?" } diff --git a/src/index.js b/src/index.js index e36317e..5448785 100755 --- a/src/index.js +++ b/src/index.js @@ -5,22 +5,30 @@ const prettyMilliseconds = require('pretty-ms'); const config = require("./config.json"); // This is the client const client = new Discord.Client(); + +function activity() { + client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' }); +}; + 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' }); + activity(); }); //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' }); + activity(); }); 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' }); + activity(); }); + +setInterval(activity, 300000); + ////// ACTUAL MESSAGE PROCESSING client.on("message", async message => { //stops bots from activating the Osselbot @@ -54,13 +62,14 @@ client.on("message", async message => { if (command === "stats") { let embed = new Discord.MessageEmbed() .setTitle('Stats') + .setAuthor("Osselbot", "https://cdn.discordapp.com/attachments/597814181084921866/711843993914310656/animated-beach-balls-29.gif") .setColor(0x195080) .setDescription(`\ **Stats for 0SSELB0T** \n \ **Uptime:** ${prettyMilliseconds(client.uptime)} \n \ **Started at:** ${client.readyAt} \n \ -**People:** ${client.users.cache.size}\ -`); +**People:** ${client.users.cache.size}`) +.setFooter("osselbot v2.0.4 run version for full info"); return message.channel.send(embed); }; //////////////////////////////////////////////////////////////////////////////