mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2024-12-22 15:36:24 -05:00
agagagagga
This commit is contained in:
parent
629486d04a
commit
4d92d34f5b
@ -21,5 +21,5 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/Technicolor-creamsicle/Osselbot/issues"
|
"url": "https://github.com/Technicolor-creamsicle/Osselbot/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/Technicolor-creamsicle/Osselbot#readme"
|
"homepage": "https://technicolor.2a03.party/bot"
|
||||||
}
|
}
|
||||||
|
24
src/index.js
24
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.
|
// Here we load the config.json file that contains our token and our prefix values.
|
||||||
const config = require("./config.json");
|
const config = require("./config.json");
|
||||||
@ -13,18 +6,7 @@ const config = require("./config.json");
|
|||||||
// config.prefix contains the message prefix.
|
// config.prefix contains the message prefix.
|
||||||
|
|
||||||
//Activity setting
|
//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 => {
|
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' });
|
client.user.setActivity(`${client.users.cache.size} of you horrible people`,{ type: 'LISTENING' });
|
||||||
@ -365,7 +347,7 @@ client.on("message", async message => {
|
|||||||
client.destroy();
|
client.destroy();
|
||||||
process.exit(69);
|
process.exit(69);
|
||||||
}
|
}
|
||||||
if (message.author.id === '258325046869622785' || '216042720047661057') {
|
if (message.author.id === '216042720047661057') {
|
||||||
message.reply("**Authenticated**, Restarting now.");
|
message.reply("**Authenticated**, Restarting now.");
|
||||||
client.user.setActivity(`Itself die`,{ type: 'WATCHING' });
|
client.user.setActivity(`Itself die`,{ type: 'WATCHING' });
|
||||||
setTimeout(shutdown, 5000, 'shutdown');
|
setTimeout(shutdown, 5000, 'shutdown');
|
||||||
|
31
src/rewrite.js
Normal file
31
src/rewrite.js
Normal 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)
|
Loading…
Reference in New Issue
Block a user