mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2025-01-02 20:56: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();
|
DEPRICATED
|
||||||
manager.on('shardCreate', shard => console.log(`Launched shard ${shard.id}`));
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"token" : "Njc4MDkzNjY4NzcwNTEyOTE3.Xr7SNw.XS_D_dEJ7hX6N5Rmnfr_OQpfznU",
|
"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");
|
const config = require("./config.json");
|
||||||
// This is the client
|
// This is the client
|
||||||
const client = new Discord.Client();
|
const client = new Discord.Client();
|
||||||
|
|
||||||
|
function activity() {
|
||||||
|
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||||
|
};
|
||||||
|
|
||||||
client.on("ready", () => {
|
client.on("ready", () => {
|
||||||
// This event will run if the bot starts, and logs in, successfully.
|
// 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.`);
|
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
|
// Example of changing the bot's playing game to something useful. `client.user` is what the
|
||||||
// docs refer to as the "ClientUser".
|
// docs refer to as the "ClientUser".
|
||||||
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
activity();
|
||||||
});
|
});
|
||||||
//Updates people count
|
//Updates people count
|
||||||
client.on('guildMemberAdd', member => {
|
client.on('guildMemberAdd', member => {
|
||||||
console.log(`New member joined: ${member.name} (id: ${member.id}).`);
|
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 => {
|
client.on('guildMemberRemove', member => {
|
||||||
console.log(` member left: ${member.name} (id: ${member.id}).`);
|
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
|
////// ACTUAL MESSAGE PROCESSING
|
||||||
client.on("message", async message => {
|
client.on("message", async message => {
|
||||||
//stops bots from activating the Osselbot
|
//stops bots from activating the Osselbot
|
||||||
@ -54,13 +62,14 @@ client.on("message", async message => {
|
|||||||
if (command === "stats") {
|
if (command === "stats") {
|
||||||
let embed = new Discord.MessageEmbed()
|
let embed = new Discord.MessageEmbed()
|
||||||
.setTitle('Stats')
|
.setTitle('Stats')
|
||||||
|
.setAuthor("Osselbot", "https://cdn.discordapp.com/attachments/597814181084921866/711843993914310656/animated-beach-balls-29.gif")
|
||||||
.setColor(0x195080)
|
.setColor(0x195080)
|
||||||
.setDescription(`\
|
.setDescription(`\
|
||||||
**Stats for 0SSELB0T** \n \
|
**Stats for 0SSELB0T** \n \
|
||||||
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
|
**Uptime:** ${prettyMilliseconds(client.uptime)} \n \
|
||||||
**Started at:** ${client.readyAt} \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);
|
return message.channel.send(embed);
|
||||||
};
|
};
|
||||||
//////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user