mirror of
https://github.com/Technicolor-creamsicle/Osselbot.git
synced 2024-09-30 06:46:13 -04:00
I did something...
Took 2 hours 27 minutes
This commit is contained in:
parent
352d001dc2
commit
889f62d66f
31
src/index.js
31
src/index.js
@ -1,7 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
// These are so I remember stuff
|
||||||
//Those are so I remember stuff
|
|
||||||
|
|
||||||
// Load up the libraries
|
// Load up the libraries
|
||||||
const Discord = require('discord.js');
|
const Discord = require('discord.js');
|
||||||
@ -16,6 +15,9 @@ const config = require('./config.json');
|
|||||||
// This is making a client for discord
|
// This is making a client for discord
|
||||||
const client = new Discord.Client();
|
const client = new Discord.Client();
|
||||||
|
|
||||||
|
// Stores the last quote
|
||||||
|
let last_quote;
|
||||||
|
|
||||||
function activity() {
|
function activity() {
|
||||||
//This function sets a status for the bot currently it is set to Do Not
|
//This function sets a status for the bot currently it is set to Do Not
|
||||||
// Disturb and "LISTENING to USERS of you, why do I do this to myself?"
|
// Disturb and "LISTENING to USERS of you, why do I do this to myself?"
|
||||||
@ -66,6 +68,10 @@ client.on('message', async message => {
|
|||||||
all know how that ends...`);
|
all know how that ends...`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reacts to messages with UwU
|
||||||
|
if (message.content.toLowerCase().includes('uwu')) await message.react(
|
||||||
|
'741755736417108071');
|
||||||
|
|
||||||
if (message.author.bot) return;
|
if (message.author.bot) return;
|
||||||
if (message.content.indexOf(config.prefix) !== 0) return;
|
if (message.content.indexOf(config.prefix) !== 0) return;
|
||||||
// Here we separate our "command" name, and our "arguments" for the command.
|
// Here we separate our "command" name, and our "arguments" for the command.
|
||||||
@ -98,7 +104,7 @@ client.on('message', async message => {
|
|||||||
// Calculates ping between sending a message and editing it, giving a
|
// Calculates ping between sending a message and editing it, giving a
|
||||||
// nice round-trip latency.
|
// nice round-trip latency.
|
||||||
const m = await message.channel.send('Ping?');
|
const m = await message.channel.send('Ping?');
|
||||||
await m.edit(`Pong! Latency is ${client.ws.ping}ms`);
|
await m.edit('Pong! Latency is`' + client.ws.ping + '` ms');
|
||||||
}
|
}
|
||||||
|
|
||||||
//HOW QUOTEABLE
|
//HOW QUOTEABLE
|
||||||
@ -120,7 +126,6 @@ client.on('message', async message => {
|
|||||||
if (!message.member.roles.cache.some(r => [
|
if (!message.member.roles.cache.some(r => [
|
||||||
'Admin',
|
'Admin',
|
||||||
'Moderator',
|
'Moderator',
|
||||||
'Member of the Order of the b l u e',
|
|
||||||
'Botmeister'].includes(r.name)))
|
'Botmeister'].includes(r.name)))
|
||||||
return message.reply('Sorry, you don\'t have permissions to use this!');
|
return message.reply('Sorry, you don\'t have permissions to use this!');
|
||||||
let embed = new Discord.MessageEmbed().setTitle('SIMP Alert').
|
let embed = new Discord.MessageEmbed().setTitle('SIMP Alert').
|
||||||
@ -196,15 +201,23 @@ client.on('message', async message => {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
if (command === 'quote') {
|
if (command === 'quote') {
|
||||||
|
|
||||||
let quotes = require(`${homedir}/quotes.json`);
|
let quotes = require(`${homedir}/quotes.json`);
|
||||||
let quoteadd = '';
|
let quoteadd = '';
|
||||||
let selector;
|
let selector;
|
||||||
try {
|
try {
|
||||||
selector = args[0].toLowerCase();
|
selector = args[0].toLowerCase();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
let number = quotes.quotes.length;
|
let length = quotes.quotes.length;
|
||||||
let quotesend = Math.floor(Math.random() * (number + 1));
|
let quotesend = 0;
|
||||||
|
|
||||||
|
function choose() {
|
||||||
|
quotesend = Math.floor(Math.random() * (length));
|
||||||
|
console.log(quotesend);
|
||||||
|
if (last_quote === quotesend) choose();
|
||||||
|
}
|
||||||
|
|
||||||
|
choose();
|
||||||
|
last_quote = quotesend;
|
||||||
return message.channel.send(`${quotes.quotes[quotesend]}`);
|
return message.channel.send(`${quotes.quotes[quotesend]}`);
|
||||||
}
|
}
|
||||||
if (selector === 'add') {
|
if (selector === 'add') {
|
||||||
@ -246,9 +259,7 @@ client.on('message', async message => {
|
|||||||
if (command === 'defcon') {
|
if (command === 'defcon') {
|
||||||
//5 levels till ban
|
//5 levels till ban
|
||||||
if (!message.member.roles.cache.some(r => [
|
if (!message.member.roles.cache.some(r => [
|
||||||
'Admin',
|
'Admin'].includes(r.name)))
|
||||||
'Member of the Order of the b l u e',
|
|
||||||
'Botmeister'].includes(r.name)))
|
|
||||||
return message.reply('Sorry, you don\'t have permissions to use this!');
|
return message.reply('Sorry, you don\'t have permissions to use this!');
|
||||||
else {
|
else {
|
||||||
let member = message.mentions.members.first();
|
let member = message.mentions.members.first();
|
||||||
|
Loading…
Reference in New Issue
Block a user