Compare commits

...

90 Commits

Author SHA1 Message Date
Emily 4241d54efd Merge pull request 'Fixing issue where woomy would endlessly type from an api error' (#2) from ItzRock/woomy:master into master
Reviewed-on: embee/woomy#2
2022-12-17 10:30:00 +00:00
ItzRock eb9c98612a Fixing issue where woomy would endlessly type from an api error 2022-02-19 22:18:39 +00:00
Emily 7cd499e10c Merge pull request 'Update 'resources/other/lyrics.json'' (#1) from f3d0r4/woomy:master into master
Reviewed-on: embee/woomy#1
2021-12-28 07:47:19 +00:00
f3d0r4 bc18ea8abd Update 'resources/other/lyrics.json'
Fixed typos of capitalization in lyrics as this would cause the command to unexpectedly fail
2021-11-25 19:36:15 +00:00
Emily 90a0aea5bf 1.4.8 (music stuff) 2021-10-15 22:29:21 +11:00
Emily ddb81ed114 minor changes to invidious endpoint format 2021-10-15 22:29:12 +11:00
Emily 55c546aa6a remove hardcoded invidious instances 2021-10-15 22:28:24 +11:00
Emily 3e80f2c5a2 updated to 1.4.7 2021-09-17 12:38:34 +10:00
Emily 5289977fb5 fix incorrect help info 2021-09-17 12:38:25 +10:00
Emily 684d49ae5b module updates 2021-09-17 12:38:15 +10:00
Emily 82bfed57aa YOUTHUBE FUCKING DSOTP CHANGING MSHIT FUCKER 2021-05-28 22:26:53 +10:00
Emily 22ac7bee2e include link to message in messageUpdate logs 2021-05-13 09:12:42 +10:00
Emily f24757fedf update deps 2021-05-13 09:01:28 +10:00
Emily 05541fe9be GO AWYA FLIES
AND OTHER GROSS BUGS
2021-04-29 12:22:30 +10:00
Emily 2564f742d4 dont silently fail when API fetch fails 2021-04-28 14:50:58 +10:00
Emily 2481dacb91 WASNT MY FAULT SHIT BROKE BLAME YOUTUBE 2021-04-13 17:25:31 +10:00
Emily f09567b239 THANK YOU FOR UNANNOUNCED API CHANGES 2021-04-13 17:25:16 +10:00
Emily 8f271a9a4e why fix bugs properly when you can ignore them 2021-04-03 15:14:12 +11:00
Emily 67c9fdfd3a bug fixes 2021-04-03 15:13:08 +11:00
Emily 5d9bbb4431 fix user error resp msg 2021-04-03 15:00:56 +11:00
Emily 26a39a76fc stage channels 2021-04-03 15:00:43 +11:00
Emily 878cab71e6 clear music msg channel on dispatcher end 2021-03-18 13:44:03 +11:00
Emily 479eeeea44 SHE CNA FUCKIGN SING AGAIN 2021-03-18 13:02:59 +11:00
Emily 1feb88451c stupid ass bitch bot 2021-03-18 12:10:09 +11:00
Emily fa99b7b1a1 missing config values 2021-03-18 12:09:28 +11:00
Emily c59bf6c245 oopsie 2021-03-01 13:05:47 +11:00
Emily 58c90ddd9d 1.4 - splatoon commands! 2021-03-01 12:58:39 +11:00
Emily 9373d9b2de THINGS 2021-03-01 12:58:28 +11:00
Emily 45d600ab27 add reactions intent 2021-03-01 12:58:11 +11:00
Emily 75b2db1a97 Merge branch 'master' of https://github.com/mudkipscience/woomy 2021-03-01 11:56:39 +11:00
Emily 42bb347bbf update dependencies 2021-03-01 11:56:33 +11:00
flgx 9326a2da3e
Merge pull request #23 from AStainlessSteelSink/master
Bind to SIGINT so Ctrl+C properly shuts down the bot
2021-02-24 08:45:13 +00:00
Lucian 0f587bcfff
Add bind to SIGINT 2021-02-23 12:58:40 -08:00
Emily 8058f3dced
Update README.md 2020-11-09 01:39:36 +00:00
Emily 8fc98efe55 new restart command x2 2020-10-29 20:23:34 +11:00
Emily a2f46051e1 working restart command 2020-10-29 20:16:41 +11:00
Emily 00196b201d new api 2020-10-27 15:06:27 +11:00
Emily 9bf1a81143 update to 1.3.13 2020-10-23 12:34:41 +11:00
Emily 98255e73aa new garfield command 2020-10-23 12:34:20 +11:00
Emily ef0e2d8594 update version 2020-10-23 12:15:05 +11:00
Emily a581f07088 remove fields dependent on presence data 2020-10-23 12:14:40 +11:00
Emily 7112c8ff9d update dependencies 2020-10-23 12:14:31 +11:00
Emily 564814a3de start requesting only the intents we need 2020-10-23 12:14:23 +11:00
Emily 05b35fc207 wtf lol 2020-10-05 18:42:06 +11:00
Emily ffd056972d fix coinflip 2020-10-05 18:38:22 +11:00
Emily 83990e47f1 Merge branch 'master' of https://github.com/mudkipscience/woomy 2020-10-03 10:53:42 +10:00
Emily 1fba1e9a4b 1.3.10 2020-10-03 10:53:38 +10:00
Emily f31f75ae79 no longer crashes when invalid equation is entered 2020-10-03 10:53:16 +10:00
Emily ba4781f0f4 request intents from gateway 2020-10-03 10:53:00 +10:00
FLGX 6d1d4a0441
Do not exit on uncaughtException
I think I forgot this here while testing something
2020-08-29 20:58:35 +02:00
Emily 18db7e597d update version number 2020-08-16 18:21:04 +10:00
Emily 3dcdd1f2ad rate can no longer ping roles 2020-08-16 18:20:26 +10:00
Emily 4bbdac7070 Renamed blacklist to blocklist 2020-08-16 18:19:28 +10:00
Emily 61e6951833 totally didnt steal this fron nyandroid 2020-08-05 17:08:56 +10:00
Emily 90e9793377 update to 1.3.7 2020-08-02 13:35:17 +10:00
Emily 0009d569ca actually fixed fixmusic 2020-08-02 13:35:09 +10:00
Emily d257d6e730 fixed "you cant vote twice" bug 2020-07-30 19:13:44 +10:00
Emily 808659246e say command can no longer mention roles 2020-07-30 19:04:54 +10:00
Emily ce10038a95 update version.json 2020-07-30 19:04:28 +10:00
TheCakeChicken f5a636b527
Disable command 2020-06-28 23:18:16 +01:00
Emily 21d4df30b3 disabled neko/nekogif 2020-06-18 20:46:42 +10:00
Lukáš Horáček 101c1581e9
enable nekogif 2020-06-17 13:55:28 +02:00
Emily 92c27be3be updated version 2020-06-17 18:13:41 +10:00
Emily 0c6e018580 added wag 2020-06-17 18:13:33 +10:00
Emily 514d1d15bc renamed foxgirl kitsune 2020-06-17 18:13:26 +10:00
Emily ab59d90bda re-enabled neko and nekogif 2020-06-17 18:12:41 +10:00
Lukáš H f8d9ec1e2f
remove stack print 2020-06-06 11:24:35 +02:00
Lukáš H 5cf74a65ab
revert 2020-06-06 11:24:12 +02:00
Lukáš H 95ce384eee
add local=true to invidious 2020-06-06 11:15:12 +02:00
Lukáš H d9ac55f8a1
print stack of error 2020-06-06 11:05:11 +02:00
Lukáš H d92f9ffb8b
fix 2020-06-06 10:49:32 +02:00
Lukáš H 6412ea346d
remove debugs 2020-06-06 10:38:00 +02:00
Lukáš H de956b5197
use invidious for music instead of youtube 2020-06-06 10:37:13 +02:00
Lukáš H a155b7dde7
add back highwatermark 2020-06-06 10:24:35 +02:00
Lukáš H 07c9972ce0
use git version of ytdl-core-discord 2020-06-06 10:24:22 +02:00
Lukáš H 52197a939e
remove watermark and see if it works 2020-06-06 10:22:10 +02:00
Lukáš H feab4749b3
more debug 2020-06-06 10:18:53 +02:00
Lukáš H 8de3c6ccad
Music debugs, cant reproduce locally 2020-06-06 10:14:56 +02:00
Lukáš H 8575fb7906
log music dispatcher errors 2020-06-06 10:07:27 +02:00
Lukáš H d585ffa45c
fix music fixer inside of play function 2020-06-06 09:57:46 +02:00
Emily 47f163dcab forgot to remove stuff from v2 2020-05-30 13:59:50 +10:00
Emily 7a1964fb4c pride update cause i couldn't wait until june 2020-05-30 13:55:04 +10:00
Emily dddaeba8e3 fixmusic can be used by users, invidious issues 2020-05-28 17:52:15 +10:00
Emily ac5d3dc78c bot can no longer use @here 2020-05-22 12:16:57 +10:00
agentdoesnotexist ebc0b198f0 Fixed typo 2020-05-20 16:54:20 +02:00
Lukáš H f9d7743caf Merge branch 'master' of github.com:woomyware/woomy 2020-05-12 10:42:03 +02:00
Lukáš H 63f5dbc6d3
message.content: Remove zero-width characters. 2020-05-12 10:41:48 +02:00
Emily 7c33e44e00 disable typing for music 2020-05-09 16:48:25 +10:00
Emily e633c6b65a update version 2020-05-09 16:47:06 +10:00
Emily b6b810b4de fixed skip + rate 2020-05-09 16:43:30 +10:00
46 changed files with 648 additions and 236 deletions

View File

@ -1,6 +1,11 @@
# Woomy
Woomy is a all-purpose discord bot built off the [guidebot](https://github.com/AnIdiotsGuide/guidebot) base and coded in node.js using discord.js.
# Notice
Woomy v1 (this repository) is currently only being maintained. Bugs and issues will be fixed if they come up, but no new features will be added. Pull requests that add new features to Woomy should instead be contributed to the version 2 codebase, found [here](https://github.com/woomyware/v2).
When Woomy v2 is released, Woomy v1 will no longer be maintained.
# How to use
The easiest way to use Woomy is to invite it to your server with [this link.](https://discord.com/oauth2/authorize?client_id=435961704145485835&permissions=2134240503&scope=bot) It is hosted 24/7 and automatically updates itself when a new release is made available, making sure you always get the newest features.

View File

@ -12,10 +12,12 @@ const config = {
"token": "", // Your bot's token.
"devtoken": "", // (optional) another token, meant for a bot used for development
"dblkey": "", // (optional) top.gg key, sends bot statistics to top.gg. You do not need this.
"sentry": "",
"server": "",
// Configurable API endpoints
endpoints: {
invidious: 'https://invidio.us/api/'
invidious: ''
},
// Default per-server settings

View File

@ -6,8 +6,17 @@ const Discord = require('discord.js');
const { promisify } = require('util');
const readdir = promisify(require('fs').readdir);
const Enmap = require('enmap');
const sentry = require('@sentry/node');
const chalk = require('chalk');
const client = new Discord.Client();
const client = new Discord.Client({ ws: { intents: [
'GUILDS',
'GUILD_MEMBERS',
'GUILD_EMOJIS',
'GUILD_VOICE_STATES',
'GUILD_MESSAGES',
'DIRECT_MESSAGES',
'GUILD_MESSAGE_REACTIONS',
]}});
try {
client.config = require('./config');
@ -47,6 +56,10 @@ if(client.config.devmodeEnabled == true && process.env['USER'] != 'container') {
const DBL = require("dblapi.js");
const dblapi = new DBL(client.config.dblkey, client);
};
if(client.config.sentry.length > 0) {
sentry.init({ dsn: client.config.sentry });
};
};
client.commands = new Enmap();
@ -90,4 +103,10 @@ const init = async () => {
};
};
init();
process.on('SIGINT', function(){
client.logger.info("Disconnecting...")
client.destroy();
process.exit();
});
init();

View File

@ -4,28 +4,28 @@
"description": "Woomy is a all-purpose discord bot built off the guidebot base and coded in node.js using discord.js.",
"main": "index.js",
"dependencies": {
"@discordjs/opus": "^0.2.1",
"better-sqlite3": "^5.4.1",
"chalk": "^4.0.0",
"dblapi.js": "^2.3.1",
"discord.js": "^12.0.2",
"enmap": "^5.2.4",
"garfield": "^1.1.2",
"@discordjs/opus": "^0.6.0",
"@sentry/node": "^6.12.0",
"better-sqlite3": "^7.4.0",
"chalk": "^4.1.1",
"dblapi.js": "^2.4.1",
"discord-paginator.js": "git+https://gitdab.com/embee/discord-paginator.js",
"discord.js": "^12.5.3",
"enmap": "^5.8.5",
"ffmpeg-static": "^4.3.0",
"hastebin-gen": "^2.0.5",
"moment": "^2.24.0",
"moment": "^2.29.1",
"moment-duration-format": "^2.3.2",
"nekos.life": "^2.0.5",
"node-fetch": "^2.6.0",
"prism-media": "^1.2.1",
"randomcolor": "^0.5.4",
"node-fetch": "^2.6.1",
"pretty-ms": "^7.0.1",
"randomcolor": "^0.6.2",
"relevant-urban": "^2.0.0",
"request": "^2.88.2",
"to-zalgo": "^1.0.1",
"urban": "^0.3.2",
"weather-js": "^2.0.0",
"ytdl-core-discord": "^1.2.0"
"ytdl-core": "^4.9.1"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},

View File

@ -15,19 +15,19 @@
"If I'm not back again this time tomorrow",
"Carry on, carry on as if nothing really matters",
"Too late, my time has come",
"sends shivers down my spine, body's aching all the time",
"Sends shivers down my spine, body's aching all the time",
"Goodbye, everybody, I've got to go",
"Gotta leave you all behind and face the truth",
"Mama, ooh, (Anyway the wind blows)",
"I don't wanna die",
"I sometimes wish I'd never been born at all",
"i see a little silhouetto of a man",
"I see a little silhouetto of a man",
"Scaramouche! Scaramouche! will you do the Fandango?",
"Thunderbolt and lightning, very, very fright'ning me",
"(Galileo) Galileo, (Galileo) Galileo, Galileo Figaro magnifico",
"I'm just a poor boy, nobody loves me",
"He's just a poor boy from a poor family",
"spare him his life from this monstrosity",
"Spare him his life from this monstrosity",
"Easy come, easy go, will you not let me go?",
"Bismillah! No, we will not let you go",
"(Let him go!) Bismillah! We will not let you go",
@ -35,17 +35,17 @@
"(Let me go) Will not let you go",
"(Let me go) Will not let you go",
"(Let me go) Ah",
"no, no, no, no, no, no, no",
"No, no, no, no, no, no, no",
"(Oh mamma mia, mamma mia) Mamma mia, let me go",
"Beelzebub has the devil put aside for me, for me, for me!",
"So you think you can stone me and spit in my eye?",
"so you think you can love me and leave me to die?",
"So you think you can love me and leave me to die?",
"Oh baby, can't do this to me, baby!",
"Just gotta get out, just gotta get right outta here!",
"Nothing really matters, anyone can see",
"nothing really matters",
"Nothing really matters",
"Nothing really matters, to me",
"any way the wind blows"
"Any way the wind blows"
],
"creeper": [

View File

@ -7,7 +7,7 @@ exports.run = async (client, message, [action, ...member]) => {
if(!action) {
return message.channel.send(
`<:error:466995152976871434> You didn't tell me if I was meant to add or remove someone from the blacklist! Usage: \`${client.commands.get(`blacklist`).help.usage}\``
`<:error:466995152976871434> You didn't tell me if I was meant to add or remove someone from the blocklist! Usage: \`${client.commands.get(`blocklist`).help.usage}\``
)
}
@ -15,7 +15,7 @@ exports.run = async (client, message, [action, ...member]) => {
if(!member) {
return message.channel.send(
`<:error:466995152976871434> You didn't tell me who to blacklist! Usage: \`${client.commands.get(`blacklist`).help.usage}\``
`<:error:466995152976871434> You didn't tell me who to add to the blocklist! Usage: \`${client.commands.get(`blocklist`).help.usage}\``
);
};
@ -41,18 +41,18 @@ exports.run = async (client, message, [action, ...member]) => {
};
if (user.id === message.guild.owner.id) {
return message.channel.send("<:error:466995152976871434> You can't blacklist the owner!")
return message.channel.send("<:error:466995152976871434> You can't add the owner to the blocklist!")
};
let admin = message.guild.member(message.author)
if (user.roles.highest.position >= admin.roles.highest.position && admin.user.id !== message.guild.ownerID) {
return message.channel.send(
`<:error:466995152976871434> You can't blacklist people higher ranked than yourself!`
`<:error:466995152976871434> You can't add people higher ranked than yourself to the blocklist!`
);
};
if(user.id === message.member.id) {
return message.channel.send('<:error:466995152976871434> You can\'t blacklist yourself!');
return message.channel.send('<:error:466995152976871434> You can\'t add yourself to the blocklist!');
};
let blacklisted = false;
@ -65,13 +65,13 @@ exports.run = async (client, message, [action, ...member]) => {
});
if(blacklisted == true) {
return message.channel.send('<:error:466995152976871434> This person has already been blacklisted!');
return message.channel.send('<:error:466995152976871434> This person is already on the blocklist!');
};
};
client.settings.push(message.guild.id, user.id, "blacklisted")
return message.channel.send(`<:success:466995111885144095> Blacklisted \`${user.user.tag}\``)
return message.channel.send(`<:success:466995111885144095> Added \`${user.user.tag}\` to the blocklist.`)
};
@ -99,26 +99,26 @@ exports.run = async (client, message, [action, ...member]) => {
});
if(blacklisted != true) {
return message.channel.send('<:error:466995152976871434> This user isn\'t blacklisted!');
return message.channel.send('<:error:466995152976871434> This user isn\'t on the blocklist!');
};
client.settings.remove(message.guild.id, user.id, "blacklisted")
return message.channel.send(`<:success:466995111885144095> Removed \`${user.user.tag}\` from the blacklist.`)
return message.channel.send(`<:success:466995111885144095> Removed \`${user.user.tag}\` from the blocklist.`)
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
aliases: ['bl'],
permLevel: "Administrator",
requiredPerms: []
};
exports.help = {
name: "blacklist",
name: "blocklist",
category: "Moderation",
description: "Allows you to configure Woomy's blacklist. Blacklisted users cannot use commands.",
usage: "blacklist [add/remove] [member]"
description: "Allows you to configure Woomy's blocklist. Users on the blocklist cannot use commands.",
usage: "blocklist [add/remove] [member]"
};

View File

@ -1,42 +1,46 @@
var allowed = ["+", "-", "*", "/", "(", ")", " "];
exports.run = (client, message, args) => {
let exercise = args.join(" ");
if (!exercise) {
return message.channel.send(
`<:error:466995152976871434> No equation provided. Usage :\`${client.commands.get(`calculate`).help.usage}\``
);
}
for (var i = 0; i < exercise.length; i++) {
let c = exercise.charAt(i);
let found = allowed.find((element) => element === c);
if(c == "0") found = true;
if(!(Number(c) || found))
{
return message.channel.send(
`<:error:466995152976871434> Invalid equation. Please use \`*\` for multiplication and \`/\` for division!`
);
}
}
let result = (new Function( 'return ' + exercise )());
var allowed = ["+", "-", "*", "/", "(", ")", " "];
exports.run = (client, message, args) => {
let exercise = args.join(" ");
if (!exercise) {
return message.channel.send(
`<:error:466995152976871434> No equation provided. Usage :\`${client.commands.get(`calculate`).help.usage}\``
);
}
message.channel.send(`\`RESULT:\`\n\`\`\`${result}\`\`\``);
};
try {
for (var i = 0; i < exercise.length; i++) {
let c = exercise.charAt(i);
let found = allowed.find((element) => element === c);
if(c == "0") found = true;
if(!(Number(c) || found))
{
return message.channel.send(
`<:error:466995152976871434> Invalid equation. Please use \`*\` for multiplication and \`/\` for division!`
);
}
}
let result = (new Function( 'return ' + exercise )());
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["calc", "math"],
permLevel: "User",
requiredPerms: []
};
message.channel.send(`\`RESULT:\`\n\`\`\`${result}\`\`\``)
} catch (err) {
message.channel.send('<:error:466995152976871434> Malformed input.')
}
};
exports.help = {
name: "calculate",
category: "Utility",
description: "Solves basic mathematical equations.",
usage: "calculate [equation]"
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["calc", "math"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "calculate",
category: "Utility",
description: "Solves basic mathematical equations.",
usage: "calculate [equation]"
};

View File

@ -5,6 +5,9 @@ exports.run = async (bot, message, args) => {
fetch('https://catfact.ninja/facts')
.then(res => res.json())
.then(json => message.channel.send(`__**Did you know?**__\n${json.data[0].fact}`))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
};

View File

@ -1,15 +1,4 @@
exports.run = (client, message, args) => {
if(!args[0]) {
return message.channel.send(
`<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`flip`).help.usage}\``
);
};
if(args[0].toLowerCase() != "heads" && args[0].toLowerCase() != "tails") {
return message.channel.send(
`<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`flip`).help.usage}\``
);
};
var coin = [
"Heads!",
"Tails!"
@ -31,5 +20,5 @@ exports.help = {
name: "coinflip",
category: "Fun",
description: "Flips a coin!",
usage: "coinflip [heads/tails]"
usage: "coinflip"
};

View File

@ -12,7 +12,7 @@ exports.run = async (client, message, args, level) => {
embed = new Discord.MessageEmbed();
embed.setTitle(colour)
embed.setColor(colour);
embed.setImage("https://api.alexflipnote.xyz/colour/image/" + colour.replace("#", ""));
embed.setImage(`https://fakeimg.pl/256x256/${colour.replace("#", "")}/?text=%20`);
message.channel.send(embed)
};

View File

@ -4,7 +4,10 @@ exports.run = async (bot, message, args) => {
try{
fetch('https://dog-api.kinduff.com/api/facts')
.then(res => res.json())
.then(json => message.channel.send(`__**Did you know?**__\n ${json.facts[0]}`));
.then(json => message.channel.send(`__**Did you know?**__\n ${json.facts[0]}`))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
};

View File

@ -2,23 +2,68 @@ const { getGuild } = require('../modules/music')
module.exports.run = async (client, message, args, level) =>{
guild = getGuild(message.guild.id)
guild.queue = []
guild.playing = false
guild.paused = false
guild.skippers = []
const lvl = client.config.permLevels.find(l => l.level === level)
if (guild.dispatcher) {
guild.dispatcher.end('silent')
if (lvl.level >= 1) {
guild.queue = []
guild.playing = false
guild.paused = false
guild.skippers = []
guild.fixers = []
guild.channel = null
if (guild.dispatcher) {
guild.dispatcher.end('silent')
}
guild.fixers = []
message.channel.send(
'<:success:466995111885144095> Music has been fixed!'
)
return
}
message.channel.send('<:success:466995111885144095> Music has been fixed (hopefully)')
const vc = message.guild.members.cache.get(client.user.id).voice.channel
if (guild.fixers.indexOf(message.author.id) === -1) {
guild.fixers.push(message.author.id)
if (guild.fixers.length >= Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)) {
guild.queue = []
guild.playing = false
guild.paused = false
guild.skippers = []
guild.fixers = []
guild.channel = null
if (guild.dispatcher) {
guild.dispatcher.end('silent')
}
guild.fixers = []
message.channel.send(
'<:success:466995111885144095> Music has been fixed!'
)
} else {
message.channel.send(
`<:success:466995111885144095> Your vote has been acknowledged! **${guild.fixers.length + '/' + Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)}**`
)
};
} else {
message.channel.send(
'<:denied:466995195150336020> You cannot vote twice!'
)
}
}
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "Moderator",
permLevel: "User",
requiredPerms: []
};

View File

@ -10,6 +10,8 @@ exports.run = (client, message) => {
skip(message.guild, 'skip')
guild.skippers = []
message.channel.send('<:success:466995111885144095> Song skipped.')
};

View File

@ -1,30 +0,0 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.foxGirl().then((json) => {
message.channel.send(json.url)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("foxgirl.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: false,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "foxgirl",
category: "Image",
description: "Sends you pictures of fox girls.",
usage: "foxgirl"
};

View File

@ -1,8 +1,26 @@
const garfield = require("garfield");
const fetch = require("node-fetch")
const { MessageEmbed } = require('discord.js')
exports.run = async (client, message) => {
message.channel.send({ files: [garfield.random()] }).catch(() => message.channel.send(
"<:error:466995152976871434> API didn't respond, try again in a few seconds."
));
message.channel.startTyping();
try {
fetch('https://garfield-comics.glitch.me/~SRoMG/?date=xxxx')
.then(res => res.json())
.then(json => {
const embed = new MessageEmbed()
.setTitle(`${json.data.name} (No. ${json.data.number})`)
.setColor(client.embedColour(message))
.setURL('https://www.mezzacotta.net/garfield/?comic=' + json.data.number)
.setImage(json.data.image.src);
message.channel.send(embed)
})
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
message.channel.stopTyping();
} catch (err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {

View File

@ -4,7 +4,10 @@ exports.run = async (client, message) => {
try {
fetch('http://inspirobot.me/api?generate=true')
.then(res => res.text())
.then(body => message.channel.send({files: [new Discord.MessageAttachment(body)]}));
.then(body => message.channel.send({files: [new Discord.MessageAttachment(body)]}))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
message.channel.stopTyping();
} catch (err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)

31
src/commands/kitsune.js Normal file
View File

@ -0,0 +1,31 @@
const fetch = require("node-fetch")
exports.run = async (client, message, args) => {
message.channel.startTyping();
try{
fetch(`https://purrbot.site/api/img/sfw/kitsune/img/`)
.then(res => res.json())
.then(json => message.channel.send(json.link))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
message.channel.stopTyping();
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
message.channel.stopTyping();
};
};
exports.conf = {
enabled: false,
guildOnly: false,
aliases: ['foxgirl'],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "kitsune",
category: "Image",
description: "Sends you cute wholesome pictures of foxgirls.",
usage: "kitsune"
};

31
src/commands/lmgtfy.js Normal file
View File

@ -0,0 +1,31 @@
const identities = require ("../../resources/other/identities.json");
exports.run = async (client, message, args) => {
if (!args[0]) {
return message.channel.send("Missing arguments, please provide me with a query!")
}
const query = args.join("+")
let link = ("https://lmgtfy.com/?q=" + query)
if (message.flags.includes('d')) {
link = "https://lmgtfy.com/?q=" + query + "&pp=1&s=d"
}
message.channel.send(link)
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "lmgtfy",
category: "Fun",
description: "For when you need to remind someone search engines exist..",
usage: "lmgtfy <question>"
};

View File

@ -1,7 +1,7 @@
exports.run = (client, message, args) => {
if (!args[0])
return message.channel.send(
`<:error:466995152976871434> No username provided. Usage: \`${client.commands.get(``).help.usage}\``
`<:error:466995152976871434> No username provided. Usage: \`${client.commands.get(`msearch`).help.usage}\``
);
var mlist = "";
var count = 0;

View File

@ -1,15 +1,16 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
const fetch = require("node-fetch")
exports.run = async (client, message, args) => {
message.channel.startTyping();
try {
sfw.neko().then((json) => {
message.channel.send(json.url);
try{
fetch(`https://purrbot.site/api/img/sfw/neko/img/`)
.then(res => res.json())
.then(json => message.channel.send(json.link))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("neko.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
message.channel.stopTyping();
};
};
@ -25,6 +26,6 @@ exports.conf = {
exports.help = {
name: "neko",
category: "Image",
description: "Sends you pictures of catgirls.",
description: "Sends you cute wholesome pictures of catgirls.",
usage: "neko"
};

View File

@ -1,21 +1,22 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
const fetch = require("node-fetch")
exports.run = async (client, message, args) => {
message.channel.startTyping();
try {
sfw.nekoGif().then((json) => {
message.channel.send(json.url);
try{
fetch(`https://purrbot.site/api/img/sfw/neko/gif/`)
.then(res => res.json())
.then(json => message.channel.send(json.link))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("nekogif.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
message.channel.stopTyping();
};
};
exports.conf = {
enabled: false,
enabled: false,
guildOnly: false,
aliases: ["catgirlgif"],
permLevel: "User",

View File

@ -17,7 +17,7 @@ exports.run = async (client, message) => {
const embed = new MessageEmbed()
embed.setTitle('Now playing')
embed.setThumbnail(s.video.videoThumbnails[1].url)
embed.setThumbnail(client.config.endpoints.invidious + s.video.videoThumbnails[1].url)
embed.setColor(client.embedColour(message))
embed.setDescription(`**[${s.video.title}](https://www.youtube.com/watch?v=${s.video.videoId})**`)
embed.addField('Channel:', s.video.author, true)

View File

@ -21,5 +21,5 @@ exports.help = {
name: "play",
category: "Music",
description: 'Plays the song you request, or adds it to the queue.',
usage: 'playnext [song]',
usage: 'play [song]',
};

48
src/commands/pride.js Normal file
View File

@ -0,0 +1,48 @@
// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license.
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 'User',
requiredPerms: ['ATTACH_FILES'],
}
exports.help = {
name: 'pride',
category: 'Fun',
description: 'Adds a pride flag ring to your avatar. Available flags are lesbian, gay, bisexual, pansexual, trans, asexual, aromantic and ally.',
usage: '`pride [flag]` - Adds a pride flag overlay to your avatar.\n`pride -g [flag]` - Adds a pride flag gradient on your avatar.',
}
const url = 'https://demirramon.com/gen/pride.png'
const Discord = require('discord.js')
exports.run = (client, message, args) => {
const flag = args[0]
if (!flag) {
return message.channel.send('<:error:466995152976871434> Missing argument, the `flag` argument is required!')
}
const available = ['lesbian', 'gay', 'bisexual', 'pansexual', 'trans', 'asexual', 'aromantic', 'ally']
if (!available.includes(flag.toLowerCase())) {
return message.channel.send(`<:error:466995152976871434> This flag isn't available, sorry ;~;\nAvailable flags: \`${available.join('`, `')}\``)
}
let gradient = 'false'
if (message.flags.includes('g')) {
gradient = 'true'
}
message.channel.startTyping()
const params = `image=${message.author.avatarURL({ format: 'png', size: 2048 })}&flag=${flag.toLowerCase()}&full=true&gradient=${gradient}&background=false&fit=true&v=2019-08-07`
try {
message.channel.stopTyping()
message.channel.send({ files: [new Discord.MessageAttachment(url + '?' + params)] })
} catch (err) {
message.channel.stopTyping()
message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``)
}
}

View File

@ -3,19 +3,25 @@ exports.run = async (client, message, args) => {
return message.channel.send(
`<:error:466995152976871434> What am I meant to rate? Usage: \`${client.commands.get(`rate`).help.usage}\``
);
var rating = [
"0/10",
"1/10",
"2/10",
"3/10",
"4/10",
"5/10",
"6/10",
"7/10",
"8/10",
"9/10",
"10/10"
];
var rating = [
"0/10",
"1/10",
"2/10",
"3/10",
"4/10",
"5/10",
"6/10",
"7/10",
"8/10",
"9/10",
"10/10"
];
if (message.content.includes("@everyone") || message.content.includes("@here") || message.content.includes("<@&")) {
return message.channel.send('>:(');
};
let mess = rating.random();
message.channel.send(`<:star:618393201501536258> I give ${args.join(" ")} a **${mess}**`);
};

View File

@ -1,14 +1,21 @@
exports.run = async (client, message) => {// eslint-disable-line no-unused-vars
const fetch = require('node-fetch');
exports.run = (client, message) => {// eslint-disable-line no-unused-vars
// This actually shuts down the bot, you'll need to use something like pm2 to get it to restart
await message.channel.send("<:reboot:467216876938985482> Restarting...");
message.channel.send("<:reboot:467216876938985482> Restarting...");
client.destroy();
require("util").promisify(setTimeout);
client.commands.forEach( async cmd => {
await client.unloadCommand(cmd);
fetch('https://gamecp.apex.to/api/client/servers/1fc76afa-9a4d-497b-983a-a898795ab5b5/power', {
method: 'post',
body: JSON.stringify({ 'signal': 'restart' }),
headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${client.config.server}` }
}).catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
process.exit();
};
exports.conf = {

View File

@ -6,6 +6,9 @@ exports.run = (client, message) => {
fetch('http://mityurl.com/y/yKsQ/r', { redirect: 'follow' })
.then(res => res)
.then(res => message.channel.send(`>:] ${res.url}`))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
};

77
src/commands/salmonrun.js Normal file
View File

@ -0,0 +1,77 @@
const Discord = require("discord.js");
const BasePaginator = require('discord-paginator.js');
const fetch = require('node-fetch');
const prettifyMiliseconds = require('pretty-ms');
exports.run = async (client, message, args) =>{
fetch('https://splatoon2.ink/data/coop-schedules.json', { headers: { 'User-Agent': client.config.userAgent }})
.then(res => res.json())
.then(json => {
fetch('https://splatoon2.ink/data/timeline.json', { headers: { 'User-Agent': client.config.userAgent }})
.then(timelineRes => timelineRes.json())
.then(timelineJson => {
const embeds = [];
if ((json.details[0].start_time * 1000) > Date.now() === true) {
embeds.push(
new Discord.MessageEmbed()
.setTitle('Upcoming Salmon Run')
.setColor(client.embedColour(message))
.setImage('https://splatoon2.ink/assets/splatnet/'+json.details[0].stage.image)
.addField('Map', json.details[0].stage.name, true)
.setFooter(`Page 1/2 | Starting in ${prettifyMiliseconds(json.details[0].start_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`)
);
} else {
embeds.push(
new Discord.MessageEmbed()
.setTitle('Current Salmon Run')
.setColor(client.embedColour(message))
.setThumbnail('https://splatoon2.ink/assets/splatnet'+timelineJson.coop.reward_gear.gear.image)
.setImage('https://splatoon2.ink/assets/splatnet/'+json.details[0].stage.image)
.addField('Map', json.details[0].stage.name, true)
.addField('Reward Gear', timelineJson.coop.reward_gear.gear.name, true)
.addField('Weapons', json.details[0].weapons[0].weapon.name+', '+json.details[0].weapons[1].weapon.name+', '+json.details[0].weapons[2].weapon.name+', '+json.details[0].weapons[3].weapon.name)
.setFooter(`Page 1/2 | Ending in ${prettifyMiliseconds((json.details[0].end_time * 1000) - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`)
);
}
embeds.push(
new Discord.MessageEmbed()
.setTitle('Upcoming Salmon Run')
.setColor(client.embedColour(message))
.setImage('https://splatoon2.ink/assets/splatnet/'+json.details[1].stage.image)
.addField('Map', json.details[1].stage.name, true)
.addField('Weapons', json.details[1].weapons[1].weapon.name+', '+json.details[1].weapons[1].weapon.name+', '+json.details[1].weapons[2].weapon.name+', '+json.details[1].weapons[3].weapon.name)
.setFooter(`Page 2/2 | Starting in ${prettifyMiliseconds(json.details[1].start_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`)
);
const Paginator = new BasePaginator({
pages: embeds,
timeout: 120000,
filter: (reaction, user) => user.id == message.author.id //to filter the reaction collector
})
Paginator.spawn(message.channel)
});
})
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "salmonrun",
category: "Splatoon",
description: "Get current map, weapons and gear for salmon run.",
usage: "salmonrun"
};

View File

@ -4,8 +4,8 @@ exports.run = (client, message, args, level) => {
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`echo`).help.usage}\``
);
};
if (message.content.includes("@everyone")) {
return message.channel.send(message.author);
if (message.content.includes("@everyone") || message.content.includes("@here") || message.content.includes("<@&")) {
return message.channel.send('>:(');
};
message.delete().catch(O_o => {});

View File

@ -80,7 +80,7 @@ exports.run = async (client, message, args) => {
embed.setAuthor("Settings for: " + message.guild.name, message.guild.iconURL({dynamic: true}))
embed.setColor(message.guild.member(client.user).displayHexColor)
embed.setDescription("You can edit these settings using the commands in the 'configure' section of the help command.")
embed.addFields({ name: "General:", value: `Prefix: \`${prefix}\`\nChat logging: ${chatChan}\nMod logging: ${modChan}\nRaid mode: ${raidMode}\nJoin/leave channel: ${greetChan}\nWelcome message: ${welcomeMessage}\nLeave message: ${leaveMessage}`, inline: true}, {name: "Roles:", value: `Moderator: ${modRole}\nAdministrator: ${adminRole}\nMuted: ${mutedRole}\nBlacklisted: ${blacklist}\nAutorole: ${autorole}`, inline: true})
embed.addFields({ name: "General:", value: `Prefix: \`${prefix}\`\nChat logging: ${chatChan}\nMod logging: ${modChan}\nRaid mode: ${raidMode}\nJoin/leave channel: ${greetChan}\nWelcome message: ${welcomeMessage}\nLeave message: ${leaveMessage}`, inline: true}, {name: "Roles:", value: `Moderator: ${modRole}\nAdministrator: ${adminRole}\nMuted: ${mutedRole}\nBlocklist: ${blacklist}\nAutorole: ${autorole}`, inline: true})
message.channel.send(embed)
};

View File

@ -12,11 +12,15 @@ exports.run = async (client, message, args) => {
]
if (!args[0]) {
return message.channel.send(client.userError(exports, 'Missing argument, the `name1` argument is required!'))
return message.channel.send(
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`ship`).help.usage}\``
);
}
if (!args[1]) {
return message.channel.send(client.userError(exports, 'Missing argument, the `name2` argument is required!'))
return message.channel.send(
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`ship`).help.usage}\``
);
}
const firstName = args[0]

View File

@ -19,6 +19,8 @@ exports.run = (client, message, args, level) => {
if (guild.queue[0].requestedBy.id === message.author.id) {
skip(message.guild, 'skip')
guild.skippers = []
message.channel.send(
'<:success:466995111885144095> Song has been skipped by the user who requested it.'
)
@ -32,6 +34,8 @@ exports.run = (client, message, args, level) => {
if (guild.skippers.length >= Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)) {
skip(message.guild, 'skip')
guild.skippers = []
message.channel.send(
'<:skip:467216735356059660> Song skipped.'
)

View File

@ -15,8 +15,12 @@ exports.run = async (client, message, args) => {
const s = guild.queue[songID]
if (!s) {
return message.channel.send('<:error:466995152976871434> No song was found in the position you specified.')
}
const embed = new MessageEmbed()
embed.setThumbnail(s.video.videoThumbnails[1].url)
embed.setThumbnail(client.config.endpoints.invidious + s.video.videoThumbnails[1].url)
embed.setColor(client.embedColour(message))
embed.setDescription(`**[${s.video.title}](https://www.youtube.com/watch?v=${s.video.videoId})**`)
embed.addField('Channel:', s.video.author, true)

53
src/commands/splatnet.js Normal file
View File

@ -0,0 +1,53 @@
const Discord = require("discord.js");
const BasePaginator = require('discord-paginator.js');
const fetch = require('node-fetch');
const prettifyMiliseconds = require('pretty-ms');
exports.run = async (client, message, args) =>{
fetch('https://splatoon2.ink//data/merchandises.json', { headers: { 'User-Agent': client.config.userAgent }})
.then(res => res.json())
.then(json => {
const embeds = [];
for ( let i = 0; i < json.merchandises.length; i++ ) {
const embed = new Discord.MessageEmbed()
.setTitle(json.merchandises[i].gear.name)
.setThumbnail('https://splatoon2.ink/assets/splatnet' + json.merchandises[i].gear.image)
.setColor(client.embedColour(message))
.addField('Price', (json.merchandises[i].price).toString(), true)
.addField('Brand', json.merchandises[i].gear.brand.name, true)
.addField('Ability Slots', (json.merchandises[i].gear.rarity + 1).toString(), true)
.addField('Main Ability', json.merchandises[i].skill.name, true)
.addField('Common Ability', json.merchandises[i].gear.brand.frequent_skill.name, true)
.setFooter(`Page ${i+1}/${json.merchandises.length} | Out of stock in ${prettifyMiliseconds(json.merchandises[i].end_time * 1000 - Date.now())} | Data provided by splatoon2.ink`);
embeds.push(embed);
}
const Paginator = new BasePaginator({
pages: embeds,
timeout: 120000,
filter: (reaction, user) => user.id == message.author.id //to filter the reaction collector
})
Paginator.spawn(message.channel)
})
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "splatnet",
category: "Splatoon",
description: "See what is currently on offer in the splatnet shop.",
usage: "splatnet"
};

View File

@ -0,0 +1,60 @@
const Discord = require("discord.js");
const BasePaginator = require('discord-paginator.js');
const fetch = require('node-fetch');
const prettifyMiliseconds = require('pretty-ms');
exports.run = async (client, message, args) =>{
fetch('https://splatoon2.ink/data/schedules.json', { headers: { 'User-Agent': client.config.userAgent }})
.then(res => res.json())
.then(json => {
const embeds = [
new Discord.MessageEmbed()
.setTitle('Current Splatoon 2 Maps')
.setColor(client.embedColour(message))
.addField('<:turf_war:814651383911153692> Turf War', `${json.regular[0].stage_a.name}\n${json.regular[0].stage_b.name}`, true)
.addField(`<:ranked:814651402479468544> Ranked: ${json.gachi[0].rule.name}`, `${json.gachi[0].stage_a.name}\n${json.gachi[0].stage_b.name}`, true)
.addField(`<:league:814651415409590363> League: ${json.league[0].rule.name}`, `${json.league[0].stage_a.name}\n${json.league[0].stage_b.name}`, true)
.setFooter(`Page 1/${json.regular.length} | Maps changing in ${prettifyMiliseconds(json.league[0].end_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`)
];
for ( let i = 1; i < json.regular.length; i++ ) {
embeds.push(
new Discord.MessageEmbed()
.setTitle('Upcoming Splatoon 2 Maps')
.setColor(client.embedColour(message))
.addField('<:turf_war:814651383911153692> Turf War', `${json.regular[i].stage_a.name}\n${json.regular[i].stage_b.name}`, true)
.addField(`<:ranked:814651402479468544> Ranked: ${json.gachi[i].rule.name}`, `${json.gachi[i].stage_a.name}\n${json.gachi[i].stage_b.name}`, true)
.addField(`<:league:814651415409590363> League: ${json.league[i].rule.name}`, `${json.league[i].stage_a.name}\n${json.league[i].stage_b.name}`, true)
.setFooter(`Page ${i+1}/${json.regular.length} | Available in ${prettifyMiliseconds(json.league[i].start_time * 1000 - Date.now(), { secondsDecimalDigits: 0 })} | Data provided by splatoon2.ink`)
);
}
const Paginator = new BasePaginator({
pages: embeds,
timeout: 120000,
filter: (reaction, user) => user.id == message.author.id //to filter the reaction collector
})
Paginator.spawn(message.channel)
})
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['splatoonmodes'],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "splatoonmaps",
category: "Splatoon",
description: "Get current and upcoming maps and modes for regular, ranked and league battles.",
usage: "splatoonmaps"
};

View File

@ -11,6 +11,8 @@ exports.run = async (client, message) => {
guild.playing = false
guild.paused = false
guild.skippers = []
guild.fixers = []
guild.channel = null
message.channel.send('<:success:466995111885144095> Playback stopped!')
};

View File

@ -1,8 +1,8 @@
const Discord = require("discord.js");
const coolPeople = require('../../resources/other/coolpeople.json')
exports.run = (client, message, args) => {
var user, guild, status, createdAt, avurl, tag, id;
var nick = "", roles = "", presence = "", badges = "";
var user, guild, createdAt, avurl, tag, id;
var nick = "", roles = "", badges = "";
var coolPerson = false;
var friendos = coolPeople.coolPeople;
@ -74,41 +74,10 @@ exports.run = (client, message, args) => {
createdAt = user.createdAt;
};
if(user.presence.status == "online") {
status = `online <:status_online:685462758023626762>`
};
if(user.presence.status == "idle") {
status = `idle <:status_idle:685462771529154561>`
};
if(user.presence.status == "dnd") {
status = `do not disturb <:status_dnd:685462782963220495>`
};
if(user.presence.status == "offline") {
status = `offline <:status_offline:685462758229016633>`
};
if(user.presence.activities[0]) {
presence = "\n• **Presence:** ";
if(user.presence.activities[0].type == "PLAYING") {
presence += `Playing ${user.presence.activities[0].name}`;
};
if(user.presence.activities[0].type == "STREAMING") {
presence += `Streaming ${user.presence.activities[0].name}`;
};
if(user.presence.activities[0].type == "CUSTOM_STATUS") {
presence += `${user.presence.activities[0].state}`;
};
};
embed = new Discord.MessageEmbed();
embed.setTitle(tag);
embed.setThumbnail(avurl);
embed.setDescription(`${badges}• **ID:** ${id}${nick}\n• **Status:** ${status}${presence}${guild}\n• **Account created:** ${createdAt}`)
embed.setDescription(`${badges}• **ID:** ${id}${nick}${guild}\n• **Account created:** ${createdAt}`)
embed.setColor(colour);
message.channel.send(embed);
};

31
src/commands/wag.js Normal file
View File

@ -0,0 +1,31 @@
const fetch = require("node-fetch")
exports.run = async (client, message, args) => {
message.channel.startTyping();
try{
fetch(`https://purrbot.site/api/img/sfw/tail/gif/`)
.then(res => res.json())
.then(json => message.channel.send(json.link))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
message.channel.stopTyping();
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "wag",
category: "Image",
description: "Wag the tail :3",
usage: "wag"
};

View File

@ -44,6 +44,7 @@ exports.run = async (client, message, args, error) => {
message.channel.send(embed)
});
} catch(err) {
message.channel.stopTyping(); // Previously wasnt here causing an issue where woomy would endlessly type.
return message.channel.send(`<:error:466995152976871434> API error: \`${err}\``)
};
};

View File

@ -9,7 +9,10 @@ exports.run = async (client, message, args) => {
try{
fetch(`http://yoda-api.appspot.com/api/v1/yodish?text=${encodeURIComponent(speech.toLowerCase())}`)
.then(res => res.json())
.then(json => message.channel.send(json.yodish));
.then(json => message.channel.send(json.yodish))
.catch(err => {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
});
message.channel.stopTyping();
} catch(err) {
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);

View File

@ -1,7 +1,8 @@
const cooldown = new Set();
module.exports = async (client, message) => {
if (message.author.bot) return;
if (typeof(message.content) === 'string') message.content = message.content.replace(/\u8203/g,'').replace(/\uB200/g,'').replace("\\uB200",''); // Remove zero-width characters
var settings;
if(message.guild) {
@ -170,7 +171,7 @@ module.exports = async (client, message) => {
if(message.guild && blacklisted == true) {
try {
return message.author.send(
`<:denied:466995195150336020> You have been blacklisted from using commands in \`${message.guild.name}\``
`<:denied:466995195150336020> You have been blocked from using commands in \`${message.guild.name}\``
);
} catch(err) {
client.logger.log(err, "error")

View File

@ -3,6 +3,8 @@ const Discord = require("discord.js");
module.exports = (client, message) => {
if (message.author.bot) return;
if(!message.guild) return;
const settings = (message.settings = client.getSettings(message.guild.id));
if (settings.chatlogsChannel !== "off") {

View File

@ -13,6 +13,7 @@ module.exports = (client, omsg, nmsg) => {
);
if (channel) {
if (!nmsg.member) return;
let embed = new Discord.MessageEmbed();
embed.setColor("#fff937");
embed.setAuthor("Message Edited!", nmsg.member.user.avatarURL({dynamic: true}));
@ -29,7 +30,7 @@ module.exports = (client, omsg, nmsg) => {
return;
}
embed.setDescription(`• Author: ${nmsg.member} (${nmsg.member.user.id})\n• Channel: ${nmsg.channel}\n• Old message: ${omsg.content}\n• New message: ${nmsg.content}`)
embed.setDescription(`[Jump to message](https://discord.com/channels/${nmsg.guild.id}/${nmsg.channel.id}/${nmsg.id})\n• Author: ${nmsg.member} (${nmsg.member.user.id})\n• Channel: ${nmsg.channel}\n• Old message: ${omsg.content}\n• New message: ${nmsg.content}`)
try {
channel.send({ embed });
} catch (err) {

View File

@ -197,7 +197,6 @@ module.exports = client => {
process.on("uncaughtException", err => {
const errorMsg = err.stack.replace(new RegExp(`${__dirname}/`, "g"), "./");
client.logger.error(`Uncaught Exception: ${errorMsg}`);
process.exit(1);
});
process.on("unhandledRejection", err => {

View File

@ -1,6 +1,6 @@
// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license.
const ytdl = require('ytdl-core-discord')
const ytdl = require('ytdl-core')
const fetch = require('node-fetch')
const { MessageEmbed } = require('discord.js')
const { utc } = require('moment')
@ -28,6 +28,7 @@ exports.getGuild = function (id) {
guild.paused = false
guild.dispatcher = null
guild.skippers = []
guild.fixers = []
exports.queue[id] = guild
}
@ -44,9 +45,9 @@ exports.getVideoByQuery = async function (client, query, message) {
try {
const id = await ytdl.getURLVideoID(query)
res = await fetch(`${client.config.endpoints.invidious}v1/videos/${id}`)
res = await fetch(`${client.config.endpoints.invidious}/api/v1/videos/${id}`)
} catch (err) {
res = await fetch(`${client.config.endpoints.invidious}v1/search?q=${encodeURIComponent(query)}`)
res = await fetch(`${client.config.endpoints.invidious}/api/v1/search?q=${encodeURIComponent(query)}`)
}
const parsed = await res.json().catch(function (e) {
@ -68,8 +69,8 @@ exports.getVideoByQuery = async function (client, query, message) {
exports.play = async function (client, message, query, playNext, ignoreQueue) {
const guild = exports.getGuild(message.guild.id)
guild.message = message
message.channel.startTyping()
// message.channel.startTyping()
if (!message.member.voice.channel && !guild.voiceChannel) {
message.channel.stopTyping()
@ -102,8 +103,10 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) {
guild.playing = false
guild.paused = false
guild.skippers = []
guild.fixers = []
guild.channel = null
// music not playing, something is in queue
} else if (!guild.playing && !guild.dispatcher && guild.queue.length > 0) {
} else if ((!guild.playing || !guild.dispatcher) && guild.queue.length > 0) {
guild.queue = []
}
@ -192,7 +195,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) {
const v = guild.queue[0]
try {
guild.dispatcher = connection.play(await ytdl(exports.getLinkFromID(v.video.videoId), { highWaterMark: 1024 * 1024 * 32 }), { type: 'opus' })
guild.dispatcher = connection.play(ytdl(v.video.videoId, { type: 'opus', bitrate: 'auto' }));
} catch (err) {
if (playNext && playNext === true) {
guild.queue.splice(1, 1)
@ -200,14 +203,19 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) {
guild.queue.pop()
}
client.logger.error(err)
return message.channel.send(`<:error:466995152976871434> An error has occured! If this issue persists, please contact my developers with this:\n\`${err}\``)
client.logger.error(err.stack)
return message.channel.send(`<:error:466995152976871434> An error has occured: \n\`${err}\``)
// return message.channel.send('<:error:466995152976871434> YouTube have made changes to their site that break Woomy\'s music module. An announcement will be made in the development server when this issue is resolved.')
}
guild.dispatcher.setVolume(0.25)
guild.channel.send('<:player:467216674622537748> Now playing: **' + v.video.title + '** `[' + exports.createTimestamp(v.video.lengthSeconds) + ']`')
// play next in queue on end
guild.dispatcher.on('error', (err) => {
console.error('[MUSIC ERROR] ' + String(err));
});
guild.dispatcher.once('finish', () => {
guild.queue.shift()
guild.playing = false
@ -219,13 +227,15 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) {
guild.playing = false
guild.paused = false
guild.skippers = []
guild.fixers = []
guild.channel = null
connection.disconnect()
}
})
}
} else {
return message.channel.channelsend('failed to find the video!')
return message.channel.send('failed to find the video!')
}
}
@ -243,4 +253,4 @@ exports.skip = function (guild, reason) {
if (g.dispatcher) {
g.dispatcher.end(reason)
}
}
}

View File

@ -1,4 +1,4 @@
{
"number": "1.3.0",
"changelog": "**1.3.0 Changelog:**\n> • Music module has been rewritten for better stability and lots more features\n> • Force disconnecting Woomy from a voice channel no longer breaks music\n> • Music should (hopefully) break less in general\n> • Existing music commands have been rewritten\n> • Added the following new commands: fixmusic, movehere, movesong, playnext, shuffle, songinfo, volume\n> • Updated ship command\n**Notes:**\n> • This will be the final major update to Woomy V1, as we are shifting our focus to Woomy V2, which is a complete rewrite."
}
"number": "1.4.8",
"changelog": "**1.4 Changelog**\n> • Splatoon commands have been added! check current and upcoming maps and modes with `~splatoonmaps`, current and upcoming salmon run maps, weapons and reward gear with `~salmonrun` and see what gear is on offer in the splatnet shop with `~splatnet`!\n**Notes:**\n> • Music is still broken and likely will be until v2 is released. Fixing v1 would delay v2 a lot, sorry >.<"
}