mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2024-12-21 23:16:23 -05:00
2.0.4 FINAL
This commit is contained in:
parent
41d0ad4f58
commit
2b98f98b1c
@ -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
|
||||
|
@ -1,4 +1,4 @@
|
||||
{
|
||||
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
|
||||
"prefix" : ";"
|
||||
"prefix" : "?"
|
||||
}
|
||||
|
19
src/index.js
19
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);
|
||||
};
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user