agagagagga

This commit is contained in:
Alex 2020-05-12 02:00:19 -05:00
parent 629486d04a
commit 4d92d34f5b
3 changed files with 35 additions and 22 deletions

View File

@ -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"
}

View File

@ -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');

31
src/rewrite.js Normal file
View File

@ -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)