From b81db48f7b26b3906fbd7ddd94ca106b095818ac Mon Sep 17 00:00:00 2001 From: TheCakeChicken Date: Mon, 30 Mar 2020 23:28:16 +0100 Subject: [PATCH 001/110] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0fde98..8d86032 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Woomy is a all-purpose discord bot built off the [guidebot](https://github.com/A # How to use The easiest way to use Woomy is to invite it to your server with [this link.](https://discordapp.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. -You can also self-host! Some modificatiomns to the code will need to be made before Woomy will run on your machine, but anyone who can read errors will figure out what needs to be changed pretty quickly :P +You can also self-host! Some modifications to the code will need to be made before Woomy will run on your machine, but anyone who can read errors will figure out what needs to be changed pretty quickly :P # Requirements - git From c7d3ecd6da26e16fefd4b87e5c97d1bc3a0423b2 Mon Sep 17 00:00:00 2001 From: FLGX Date: Wed, 8 Apr 2020 11:04:52 +0200 Subject: [PATCH 002/110] Fix music in v1 woomy --- src/modules/functions.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/functions.js b/src/modules/functions.js index a30dd4b..f8c552c 100644 --- a/src/modules/functions.js +++ b/src/modules/functions.js @@ -229,7 +229,16 @@ module.exports = client => { }; id = item.id.videoId; } - + + // music "playing", nothing in queue + if((client.music.getGuild(message.guild.id).playing || client.music.getGuild(message.guild.id).dispatcher) && client.music.getGuild(message.guild.id).queue.length == 0) { + client.music.getGuild(message.guild.id).playing = false; + client.music.getGuild(message.guild.id).dispatcher = null; + // music not playing, something is in queue + } else if(!client.music.getGuild(message.guild.id).playing && !client.music.getGuild(message.guild.id).dispatcher && client.music.getGuild(message.guild.id).queue.length > 0) { + client.music.getGuild(message.guild.id).queue = []; + }; + if(client.music.getGuild(message.guild.id).queue.length == 0 || bypassQueue) { let meta = await client.music.getMeta(id); From 276c26d3c7d4e3bf6ffbf28152f3ea4998b9a34a Mon Sep 17 00:00:00 2001 From: FLGX Date: Wed, 8 Apr 2020 11:10:44 +0200 Subject: [PATCH 003/110] remove member username/id print on command --- src/events/message.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/message.js b/src/events/message.js index 7c399a8..447bd5b 100644 --- a/src/events/message.js +++ b/src/events/message.js @@ -229,7 +229,7 @@ module.exports = async (client, message) => { cooldown.delete(message.author.id); }, 2000); - client.logger.cmd(`${client.config.permLevels.find(l => l.level === level).name} ${message.author.username} (${message.author.id}) ran command ${cmd.help.name}`); + client.logger.cmd(`${client.config.permLevels.find(l => l.level === level).name} ran command ${cmd.help.name}`); cmd.run(client, message, args, level); }; From c188356030c7178e975c09bce42b72bff733e92c Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Fri, 17 Apr 2020 17:14:42 +1000 Subject: [PATCH 004/110] update ytdl-core --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 891ab34..fa5d116 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@discordjs/opus": "^0.1.0", "better-sqlite3": "^5.4.1", - "chalk": "^3.0.0", + "chalk": "^4.0.0", "dblapi.js": "^2.3.1", "discord.js": "^12.0.2", "enmap": "^5.2.4", @@ -26,7 +26,7 @@ "urban": "^0.3.2", "weather-js": "^2.0.0", "youtube-info": "^1.3.2", - "ytdl-core-discord": "^1.1.0" + "ytdl-core-discord": "^1.2.0" }, "devDependencies": {}, "scripts": { From 0662be72d110e95e4af94c530fd0cef7bbd310f8 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 18 Apr 2020 04:11:13 +0000 Subject: [PATCH 005/110] why are unhandled rejections trying to log a stack --- src/modules/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/functions.js b/src/modules/functions.js index f8c552c..46ad1e4 100644 --- a/src/modules/functions.js +++ b/src/modules/functions.js @@ -386,6 +386,6 @@ module.exports = client => { }); process.on("unhandledRejection", err => { - client.logger.error(`Unhandled rejection: ${err.stack}`); + client.logger.error(`Unhandled rejection: ${err}`); }); }; From 57ad4914f86f447303c5d1d9c85667fb878146e5 Mon Sep 17 00:00:00 2001 From: FLGX Date: Sat, 18 Apr 2020 21:34:41 +0200 Subject: [PATCH 006/110] set volume to 25% by default for now before v2 woomy is released --- src/modules/functions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/functions.js b/src/modules/functions.js index 46ad1e4..eb759a1 100644 --- a/src/modules/functions.js +++ b/src/modules/functions.js @@ -280,6 +280,8 @@ module.exports = client => { { let dispatcher = client.music.getGuild(message.guild.id).dispatcher = connection.play(await ytdl("https://www.youtube.com/watch?v=" + id, {highWaterMark: 1024 * 1024 * 32}), {type: 'opus'}); + dispatcher.setVolume(0.25) + dispatcher.on('finish', (a, b) => { end(a == "silent"); From 79b14f60aa745d00da5978874ec2d3ae5888fbcd Mon Sep 17 00:00:00 2001 From: TheCakeChicken Date: Sun, 19 Apr 2020 00:22:57 +0100 Subject: [PATCH 007/110] Remove potentially NSFW content --- .gitignore | 3 ++- src/commands/foxgirl.js | 2 +- src/commands/kemonomimi.js | 2 +- src/commands/neko.js | 2 +- src/commands/nekogif.js | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 656811d..1f83f4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules data config.js -package-lock.json \ No newline at end of file +package-lock.json +.env \ No newline at end of file diff --git a/src/commands/foxgirl.js b/src/commands/foxgirl.js index f3f3312..3d8a0e6 100644 --- a/src/commands/foxgirl.js +++ b/src/commands/foxgirl.js @@ -15,7 +15,7 @@ exports.run = async (client, message) => { }; exports.conf = { - enabled: true, + enabled: false, guildOnly: false, aliases: [], permLevel: "User", diff --git a/src/commands/kemonomimi.js b/src/commands/kemonomimi.js index 3c4b70e..7d16938 100644 --- a/src/commands/kemonomimi.js +++ b/src/commands/kemonomimi.js @@ -15,7 +15,7 @@ exports.run = async (client, message) => { }; exports.conf = { - enabled: true, + enabled: false, guildOnly: false, aliases: [], permLevel: "User", diff --git a/src/commands/neko.js b/src/commands/neko.js index 7ce0d6b..6e62f19 100644 --- a/src/commands/neko.js +++ b/src/commands/neko.js @@ -15,7 +15,7 @@ exports.run = async (client, message) => { }; exports.conf = { - enabled: true, + enabled: false, guildOnly: false, aliases: ["catgirl"], permLevel: "User", diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js index 0df6917..cc878e8 100644 --- a/src/commands/nekogif.js +++ b/src/commands/nekogif.js @@ -15,7 +15,7 @@ exports.run = async (client, message) => { }; exports.conf = { - enabled: true, + enabled: false, guildOnly: false, aliases: ["catgirlgif"], permLevel: "User", From f702254603d2e3d3e01e734bbfaf85d5956ad9f9 Mon Sep 17 00:00:00 2001 From: TheCakeChicken Date: Sun, 19 Apr 2020 00:40:05 +0100 Subject: [PATCH 008/110] actually disable potentially NSFW commands --- src/commands/foxgirl.js | 3 ++- src/commands/kemonomimi.js | 4 ++-- src/commands/neko.js | 4 ++-- src/commands/nekogif.js | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/commands/foxgirl.js b/src/commands/foxgirl.js index 3d8a0e6..a2a2d40 100644 --- a/src/commands/foxgirl.js +++ b/src/commands/foxgirl.js @@ -1,4 +1,4 @@ -const API = require('nekos.life'); +/*const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -28,3 +28,4 @@ exports.help = { description: "Sends you pictures of fox girls.", usage: "foxgirl" }; +*/ \ No newline at end of file diff --git a/src/commands/kemonomimi.js b/src/commands/kemonomimi.js index 7d16938..dbf4d6d 100644 --- a/src/commands/kemonomimi.js +++ b/src/commands/kemonomimi.js @@ -1,4 +1,4 @@ -const API = require('nekos.life'); +/*const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -27,4 +27,4 @@ exports.help = { category: "Image", description: "Sends you pictures of people with animal characteristics.", usage: "kemonomimi" -}; +};*/ diff --git a/src/commands/neko.js b/src/commands/neko.js index 6e62f19..301e850 100644 --- a/src/commands/neko.js +++ b/src/commands/neko.js @@ -1,4 +1,4 @@ -const API = require('nekos.life'); +/*const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -27,4 +27,4 @@ exports.help = { category: "Image", description: "Sends you pictures of catgirls.", usage: "neko" -}; +};*/ diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js index cc878e8..c3405d2 100644 --- a/src/commands/nekogif.js +++ b/src/commands/nekogif.js @@ -1,4 +1,4 @@ -const API = require('nekos.life'); +/*const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -27,4 +27,4 @@ exports.help = { category: "Image", description: "Sends you gifs of catgirls.", usage: "nekogif" -}; +};*/ From 536c6f2b2aa9b8f0a4d1686447792fd288393540 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 20 Apr 2020 02:49:36 +0000 Subject: [PATCH 009/110] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa5d116..0baac56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "woomy", - "version": "1.1.0", + "version": "1.2.3", "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": { From 5fd8da270277b58eae68c5da25a9aff734aa076e Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 21 Apr 2020 17:05:40 +1000 Subject: [PATCH 010/110] fixed skip command --- src/commands/skip.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/skip.js b/src/commands/skip.js index c997c18..e62db40 100644 --- a/src/commands/skip.js +++ b/src/commands/skip.js @@ -6,9 +6,9 @@ exports.run = (client, message, args, level) => { "<:error:466995152976871434> Nothing is playing." ); - let vc = message.guild.members.cache.get(client.user.id).voiceChannel; + let vc = message.guild.members.cache.get(client.user.id).voice.channel; - if(vc != message.member.voiceChannel) return message.channel.send( + if(vc != message.member.voice.channel) return message.channel.send( '<:error:466995152976871434> You need to be in my voice channel to use this command!' ); From 7e4b3556273b38299bb066f49cda71919d6218ac Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 21 Apr 2020 17:06:03 +1000 Subject: [PATCH 011/110] update version --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 6d6b7a3..a28546d 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.2.3", + "number": "1.2.4", "changelog": "**1.2.0 CHANGELOG:**\n> • Added action commands! (`cuddle`, `feed`, `hug`, `kiss`, `pat`, `poke`, `slap`, `smug`, `tickle`)\n> • Added `fact`\n> • Added `catfact`\n> • Added `dogfact`\n> • Added `yoda`\n> • Added `dice`\n> • Added `spoilerise`\n> • Added `zalgo`\n> • Added `dog`\n> • Added `cat`\n> • Added `lizard`\n> • Added `neko`\n> • Added `nekogif`\n> • Added `kemonomimi`\n> • Added `foxgirl`\n> • Added `identity`\n> • Added `pronouns`\n> • Added `sexuality`\n> • Added `ship`\n> • Renamed `flip to `coinflip` (flip remains as an alias)\n> • Renamed `math` to `calculate` (math is an alias)\n> • @Woomy is now a prefix\n> • Added the `inspire` alias to `inspirobot`\n> • Help now displays the amount of commands in each category\n> • Bots now get a badge in `userinfo`\n> • `roleinfo` now displays what permissions a role has\n> • small changes to `weather`\n> • Woomy now has clear logging of issues that prevent her from starting\n> • request npm module has been swapped out for node-fetch\n**NOTES:**\n> Thank you to Terryiscool160 for creating multiple commands used in this update" } From debd47fe0277b89c75142ded0885ba4b9b200cd4 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 21 Apr 2020 17:09:27 +1000 Subject: [PATCH 012/110] cmd.conf.enabled actually does something now --- src/events/message.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/events/message.js b/src/events/message.js index 447bd5b..465ce3f 100644 --- a/src/events/message.js +++ b/src/events/message.js @@ -163,6 +163,10 @@ module.exports = async (client, message) => { return message.author.send(`<:error:466995152976871434> I don't have permission to speak in **#${message.channel.name}**, Please ask a moderator to give me the send messages permission!`); }; + if (!cmd.conf.enabled) { + return message.channel.send('<:error:466995152976871434> This command has been disabled by my developers.') + } + if(message.guild && blacklisted == true) { try { return message.author.send( From 7eab55b98136879f1bc9ef76bd23a917c427998b Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 21 Apr 2020 17:33:18 +1000 Subject: [PATCH 013/110] disabled problematic commands --- src/commands/foxgirl.js | 3 +-- src/commands/kemonomimi.js | 4 ++-- src/commands/neko.js | 4 ++-- src/commands/nekogif.js | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/commands/foxgirl.js b/src/commands/foxgirl.js index a2a2d40..3d8a0e6 100644 --- a/src/commands/foxgirl.js +++ b/src/commands/foxgirl.js @@ -1,4 +1,4 @@ -/*const API = require('nekos.life'); +const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -28,4 +28,3 @@ exports.help = { description: "Sends you pictures of fox girls.", usage: "foxgirl" }; -*/ \ No newline at end of file diff --git a/src/commands/kemonomimi.js b/src/commands/kemonomimi.js index dbf4d6d..7d16938 100644 --- a/src/commands/kemonomimi.js +++ b/src/commands/kemonomimi.js @@ -1,4 +1,4 @@ -/*const API = require('nekos.life'); +const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -27,4 +27,4 @@ exports.help = { category: "Image", description: "Sends you pictures of people with animal characteristics.", usage: "kemonomimi" -};*/ +}; diff --git a/src/commands/neko.js b/src/commands/neko.js index 301e850..6e62f19 100644 --- a/src/commands/neko.js +++ b/src/commands/neko.js @@ -1,4 +1,4 @@ -/*const API = require('nekos.life'); +const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -27,4 +27,4 @@ exports.help = { category: "Image", description: "Sends you pictures of catgirls.", usage: "neko" -};*/ +}; diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js index c3405d2..cc878e8 100644 --- a/src/commands/nekogif.js +++ b/src/commands/nekogif.js @@ -1,4 +1,4 @@ -/*const API = require('nekos.life'); +const API = require('nekos.life'); const {sfw} = new API(); exports.run = async (client, message) => { message.channel.startTyping(); @@ -27,4 +27,4 @@ exports.help = { category: "Image", description: "Sends you gifs of catgirls.", usage: "nekogif" -};*/ +}; From 0cb1d15f12e4dfd10144019f0296776b3eec4816 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 13:10:53 +1000 Subject: [PATCH 014/110] remove music functions from functions.js --- src/modules/functions.js | 182 --------------------------------------- 1 file changed, 182 deletions(-) diff --git a/src/modules/functions.js b/src/modules/functions.js index eb759a1..0d62623 100644 --- a/src/modules/functions.js +++ b/src/modules/functions.js @@ -147,188 +147,6 @@ module.exports = client => { return client.users.cache.get(mention); } } - - - // MUSIC - client.music = {guilds: {}}; - - client.music.isYoutubeLink = function(input) { - return input.startsWith('https://www.youtube.com/') || input.startsWith('http://www.youtube.com/') || input.startsWith('https://youtube.com/') || input.startsWith('http://youtube.com/') || input.startsWith('https://youtu.be/') || input.startsWith('http://youtu.be/') || input.startsWith('http://m.youtube.com/') || input.startsWith('https://m.youtube.com/'); - } - - client.music.search = async function(query) - { - return new Promise(function(resolve, reject) - { - try{ - fetch("https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=" + encodeURIComponent(query) + "&key=" + client.config.ytkey) - .then(res => res.json()) - .then(json => { - if(!json.items) { reject(); return; } - resolve(json.items[0]); - }); - } catch (err) { - client.logger.error("Music search err: ", err); - throw err; - }; - }); - } - - client.music.getGuild = function(id) - { - if(client.music.guilds[id]) return client.music.guilds[id]; - - return client.music.guilds[id] = - { - queue: [], - playing: false, - paused: false, - dispatcher: null, - skippers: [] - } - } - - client.music.getMeta = async function(id) - { - return new Promise(function(resolve, reject) - { - youtubeInfo(id, function(err, videoInfo) - { - if(err) throw err; - - resolve(videoInfo); - }); - }); - } - - client.music.play = async function(message, input, bypassQueue) - { - let voiceChannel = message.member.voice.channel; - if(!voiceChannel) return message.channel.send('<:error:466995152976871434> You need to be in a voice channel to use this command!'); - - let permissions = voiceChannel.permissionsFor(client.user); - if (!permissions.has('CONNECT')) { - return message.channel.send('<:error:466995152976871434> I do not have permission to join your voice channel.'); - } - if (!permissions.has('SPEAK')) { - return message.channel.send('<:error:466995152976871434> I do not have permission to join your voice channel.'); - } - if (voiceChannel.joinable != true) { - return message.channel.send("<:error:466995152976871434> I do not have permission to join your voice channel.") - } - - let id = undefined; - - if(client.music.isYoutubeLink(input)) - { - id = await getYoutubeId(input) - } else { - let item = await client.music.search(input); - if(!item) { - return message.channel.send(`<:error:466995152976871434> No results found.`); - }; - id = item.id.videoId; - } - - // music "playing", nothing in queue - if((client.music.getGuild(message.guild.id).playing || client.music.getGuild(message.guild.id).dispatcher) && client.music.getGuild(message.guild.id).queue.length == 0) { - client.music.getGuild(message.guild.id).playing = false; - client.music.getGuild(message.guild.id).dispatcher = null; - // music not playing, something is in queue - } else if(!client.music.getGuild(message.guild.id).playing && !client.music.getGuild(message.guild.id).dispatcher && client.music.getGuild(message.guild.id).queue.length > 0) { - client.music.getGuild(message.guild.id).queue = []; - }; - - if(client.music.getGuild(message.guild.id).queue.length == 0 || bypassQueue) - { - let meta = await client.music.getMeta(id); - - if(!bypassQueue) client.music.getGuild(message.guild.id).queue.push({input: input, id: id, requestedBy: message.author, title: meta.title, author: meta.owner, thumbnail: meta.thumbnailUrl, duration: meta.duration}); - - let connection = await new Promise((resolve, reject) => - { - voiceChannel.join().then((connection) => - { - resolve(connection); - }); - }); - - function end(silent) - { - client.music.getGuild(message.guild.id).queue.shift(); - client.music.getGuild(message.guild.id).dispatcher = null; - - if(client.music.getGuild(message.guild.id).queue.length > 0) - { - client.music.play(message, client.music.getGuild(message.guild.id).queue[0].input, true); - } else { - client.music.getGuild(message.guild.id).playing = false; - - if(!silent) { - message.channel.send("<:play:467216788187512832> Queue is empty! Disconnecting from the voice channel."); - } - - connection.disconnect(); - } - } - - client.music.getGuild(message.guild.id).playing = true; - - let song = client.music.getGuild(message.guild.id).queue[0]; - - try - { - let dispatcher = client.music.getGuild(message.guild.id).dispatcher = connection.play(await ytdl("https://www.youtube.com/watch?v=" + id, {highWaterMark: 1024 * 1024 * 32}), {type: 'opus'}); - - dispatcher.setVolume(0.25) - - dispatcher.on('finish', (a, b) => - { - end(a == "silent"); - }); - } catch(err) { - message.channel.send('<:error:466995152976871434> Failed to play **' + song.title + '** ' + err); - - end(); - } - - client.music.getGuild(message.guild.id).skippers = []; - message.channel.send(`<:play:467216788187512832> Now playing: **${song.title}**`); - } else { - let meta = await client.music.getMeta(id); - let song = {input: input, id: id, requestedBy: message.author, title: meta.title, author: meta.owner, thumbnail: meta.thumbnailUrl, duration: meta.duration}; - - client.music.getGuild(message.guild.id).queue.push(song); - - message.channel.send(`<:success:466995111885144095> Added to queue: **${song.title}**`); - } - } - - // MUSIC - TIMESTAMP - client.createTimestamp = function(duration){ - hrs = ~~(duration / 60 / 60), - min = ~~(duration / 60) % 60, - sec = ~~(duration - min * 60); - - if(String(hrs).length < 2) { - hrs = "0" + String(hrs) + ":"; - }; - - if(String(min).length < 2) { - min = "0" + String(min); - }; - - if(String(sec).length < 2) { - sec = "0" + String(sec); - }; - - if(hrs == "00:") { - hrs = ""; - } - - var time = hrs + min + ":" + sec; - return time; - }; //FIND ROLE client.findRole = function(input, message) { From a5ee79476f1e8bcf99f9e60894ff93c62acd1ea6 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 13:16:49 +1000 Subject: [PATCH 015/110] update/remove dependencies --- package.json | 5 +---- src/modules/functions.js | 5 ----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/package.json b/package.json index 0baac56..73e312c 100644 --- a/package.json +++ b/package.json @@ -4,20 +4,18 @@ "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.1.0", + "@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", - "get-youtube-id": "^1.0.1", "hastebin-gen": "^2.0.5", "moment": "^2.24.0", "moment-duration-format": "^2.3.2", "nekos.life": "^2.0.5", "node-fetch": "^2.6.0", - "openweather-apis": "^4.2.0", "prism-media": "^1.2.1", "randomcolor": "^0.5.4", "relevant-urban": "^2.0.0", @@ -25,7 +23,6 @@ "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", - "youtube-info": "^1.3.2", "ytdl-core-discord": "^1.2.0" }, "devDependencies": {}, diff --git a/src/modules/functions.js b/src/modules/functions.js index 0d62623..6a3a9b7 100644 --- a/src/modules/functions.js +++ b/src/modules/functions.js @@ -1,8 +1,3 @@ -const ytdl = require('ytdl-core-discord'); -const youtubeInfo = require('youtube-info'); -const getYoutubeId = require('get-youtube-id'); -const fetch = require('node-fetch'); - module.exports = client => { // Permission level function client.permlevel = message => { From d07a680b7724adb772a6d967ae579c66cc957c9e Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 13:18:44 +1000 Subject: [PATCH 016/110] update configTemplate --- configTemplate.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configTemplate.js b/configTemplate.js index b6e96c3..2c516a0 100644 --- a/configTemplate.js +++ b/configTemplate.js @@ -11,8 +11,12 @@ const config = { // Tokens "token": "", // Your bot's token. "devtoken": "", // (optional) another token, meant for a bot used for development - "ytkey": "", // Youtube API key, needed for music searching to work - "dblkey": "", // top.gg key, sends bot statistics to top.gg. You do not need this. + "dblkey": "", // (optional) top.gg key, sends bot statistics to top.gg. You do not need this. + + // Configurable API endpoints + endpoints: { + invidious: 'https://invidio.us/api/' + }, // Default per-server settings "defaultSettings" : { From def26feab35054802c806bc84fde0f358cee7430 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 13:32:19 +1000 Subject: [PATCH 017/110] update rip.js to use node-fetch instead of request --- src/commands/rip.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/commands/rip.js b/src/commands/rip.js index d677655..968e08a 100644 --- a/src/commands/rip.js +++ b/src/commands/rip.js @@ -1,12 +1,15 @@ -var request = require('request'); +const fetch = require('node-fetch'); const Discord = require("discord.js") exports.run = (client, message) => { message.channel.startTyping(); - var r = request.get('http://mityurl.com/y/yKsQ/r', function (err, res, body) { - var rip = r.uri.href - message.channel.send(`>:] ${rip}`) - message.channel.stopTyping(); - }); + try{ + 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}`); + }; + message.channel.stopTyping(); } exports.conf = { From d1acf688c9643c0e9266edea3caf1c1f0b4811b8 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 14:06:09 +1000 Subject: [PATCH 018/110] update music commands to support new module --- src/commands/forceskip.js | 23 ++-- src/commands/nowplaying.js | 43 ++++--- src/commands/pause.js | 23 ++-- src/commands/play.js | 24 ++-- src/commands/queue.js | 245 ++++++++++++++++++------------------- src/commands/removesong.js | 42 +++---- src/commands/resume.js | 23 ++-- src/commands/skip.js | 69 ++++++----- src/commands/stop.js | 20 +-- 9 files changed, 250 insertions(+), 262 deletions(-) diff --git a/src/commands/forceskip.js b/src/commands/forceskip.js index 7e341d6..0271d8e 100644 --- a/src/commands/forceskip.js +++ b/src/commands/forceskip.js @@ -1,11 +1,16 @@ +const { skip, getGuild } = require('../modules/music') exports.run = (client, message) => { - let guild = client.music.getGuild(message.guild.id); + const guild = getGuild(message.guild.id) - if(guild.queue.length < 1) return message.channel.send( - `<:error:466995152976871434> There is nothing for me to skip!` - ); - skip_song(guild); - message.channel.send("<:skip:467216735356059660> Skipped the song!") + if (guild.queue.length < 1 || !guild.playing || !guild.dispatcher) { + return message.channel.send( + '<:error:466995152976871434> Nothing is playing.' + ) + } + + skip(message.guild, 'skip') + + message.channel.send('<:success:466995111885144095> Song skipped.') }; exports.conf = { @@ -13,7 +18,7 @@ exports.conf = { guildOnly: true, aliases: [], permLevel: "Moderator", - requiredPerms: ["SPEAK"] + requiredPerms: [] }; exports.help = { @@ -22,7 +27,3 @@ exports.help = { description: "Skips the currently playing song without requiring a vote.", usage: "forceskip" }; - -function skip_song(guild) { - guild.dispatcher.end(); -} diff --git a/src/commands/nowplaying.js b/src/commands/nowplaying.js index e94f71a..c26222d 100644 --- a/src/commands/nowplaying.js +++ b/src/commands/nowplaying.js @@ -1,31 +1,30 @@ -const Discord = require("discord.js"); +const { getGuild, createTimestamp } = require('../modules/music') +const { MessageEmbed } = require('discord.js') exports.run = async (client, message) => { - let guild = client.music.getGuild(message.guild.id); - - if(guild.queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); + const guild = getGuild(message.guild.id) + + if (guild.queue.length < 1) { + return message.channel.send(client.config.emojis.error + ' Nothing is in the queue!') } - var song = guild.queue[0]; - var elapsedTime = client.createTimestamp(guild.dispatcher.streamTime / 1000); - var timestamp; + const s = guild.queue[0] + const elapsedTime = createTimestamp(guild.dispatcher.streamTime / 1000) + let timestamp = `\`[${createTimestamp(s.video.lengthSeconds)}]\`` - if(song.duration == 0) { - timestamp = "`[LIVE]`"; - } else { - timestamp = `\`[${elapsedTime + "/" + client.createTimestamp(song.duration)}]\``; - }; + if (timestamp !== '`[LIVE]`') { + timestamp = `\`[${elapsedTime + '/' + createTimestamp(s.video.lengthSeconds)}]\`` + } - embed = new Discord.MessageEmbed(); - embed.setTitle("Now playing:") - embed.setThumbnail(song.thumbnail) - embed.setColor(client.embedColour(message)); - embed.setDescription(`**[${song.title}](https://www.youtube.com/watch?v=${song.id})**`) - embed.addField("Channel:", song.author, true) - embed.addField("Time:", timestamp, true) - embed.setFooter("Requested by " + song.requestedBy.tag, song.requestedBy.avatarURL({format: "png", dynamic: true, size: 2048})) + const embed = new MessageEmbed() + embed.setTitle('Now playing') + embed.setThumbnail(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) + embed.addField('Time:', timestamp, true) + embed.setFooter('Requested by ' + s.requestedBy.tag, s.requestedBy.avatarURL({ format: 'png', dynamic: true, size: 2048 })) - message.channel.send(embed) + message.channel.send(embed) }; exports.conf = { diff --git a/src/commands/pause.js b/src/commands/pause.js index 2816baf..e1500e2 100644 --- a/src/commands/pause.js +++ b/src/commands/pause.js @@ -1,15 +1,20 @@ +const { getGuild } = require('../modules/music') exports.run = (client, message, args, level) => { - let guild = client.music.getGuild(message.guild.id); - if(guild.queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); - }; + const guild = getGuild(message.guild.id) - guild.playing = false; - guild.paused = true; - guild.dispatcher.pause(); - message.channel.send("<:pause:467639357961142273> Playback paused!"); + if (guild.paused === true) { + return message.channel.send('<:error:466995152976871434> The music has already been paused! Run resume to start the music again.') + } + if (guild.queue.length < 1 || guild.playing === false) { + return message.channel.send('<:error:466995152976871434> Nothing is playing!') + } + guild.playing = false + guild.paused = true + guild.dispatcher.pause() + + message.channel.send('<:pause:467639357961142273> Music playback has been paused.') }; exports.conf = { @@ -17,7 +22,7 @@ exports.conf = { guildOnly: true, aliases: [], permLevel: "Moderator", - requiredPerms: ["CONNECT", "SPEAK"] + requiredPerms: [] }; exports.help = { diff --git a/src/commands/play.js b/src/commands/play.js index d9c8866..882aedd 100644 --- a/src/commands/play.js +++ b/src/commands/play.js @@ -1,20 +1,12 @@ -const util = require("util") +const { play } = require('../modules/music') const Discord = require("discord.js") -module.exports.run = (client, message, args, level) =>{ - if(!args[0]) - { - message.channel.send(`<:error:466995152976871434> You didn't give me a song to play! Usage: \`${client.commands.get(`play`).help.usage}\``); - - return; - } +module.exports.run = async (client, message, args, level) =>{ + if (!args[0]) { + return message.channel.send(`<:error:466995152976871434> You didn't give me a song name or YouTube URL! Usage: \`${client.commands.get('play').help.usage}\``) + } - let voiceChannel = message.member.voice.channel; - if(!voiceChannel) return message.channel.send('<:error:466995152976871434> You need to be in a voice channel to use this command!'); - - message.channel.send(`🔎 searching YouTube for \`${args.join(" ")}\``); - - client.music.play(message, args.join(" ")); + await play(client, message, args.join(' '), false) } exports.conf = { @@ -28,6 +20,6 @@ exports.conf = { exports.help = { name: "play", category: "Music", - description: "Plays a song.", - usage: "play [youtube-url] **OR** play [song-name]" + description: 'Plays the song you request, or adds it to the queue.', + usage: 'playnext [song]', }; diff --git a/src/commands/queue.js b/src/commands/queue.js index 0bdc87e..7ac4d79 100644 --- a/src/commands/queue.js +++ b/src/commands/queue.js @@ -1,171 +1,162 @@ 'use strict'; -const Discord = require("discord.js"); +const { getGuild, createTimestamp } = require('../modules/music') +const Discord = require('discord.js') exports.run = (client, message, args) => { - var queue = client.music.getGuild(message.guild.id).queue; + var queue = getGuild(message.guild.id).queue - if(queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); + if (queue.length < 1) { + return message.channel.send('<:error:466995152976871434> Nothing is playing.') } - let lists = []; + const lists = [] - function generateList(start, number) { - var list = ""; - var timestamp; - var livestream; + function generateList (start, number) { + let list = '' + let timestamp - if(start == 1 && queue.length == 1) { - return ["There's nothing else waiting to be played!", 1]; + if (start === 1 && queue.length === 1) { + return ['There\'s nothing else waiting to be played!', 1] } - if(number == 1 && queue.length + 1 < start) { - return false; - }; - - let q = queue.slice(start); - - let i = 0; - - for(i = 0; i < q.length; i++) { - let song = q[i]; - - if(song.duration == 0) { - timestamp = "LIVE"; - livestream = true; - } else { - timestamp = client.createTimestamp(song.duration); - }; - - let aaa = list + `\`${(i + 1) + start - 1}:\` **[${song.title}](https://www.youtube.com/watch?v=${song.id})** added by ${song.requestedBy} \`[${timestamp}]\`\n`; - - if(aaa.length > 1024) { - return [list, start + i - 1]; - } else { - list = aaa; - } - - //totalDuration = totalDuration + song.duration; - }; - - return [list, start + i + 1]; - }; - - let songsInQueue = queue.length - 1; - let songsInQueueEnglish = "song"; - let timeRemaining = 0; - - function generatePage(list, page) { - if(!list || list == "") { - return false; + if (number === 1 && queue.length + 1 < start) { + return false } - var embed = new Discord.MessageEmbed(); - embed.setTitle(`Queue for: ${message.guild.name}`); - embed.setColor(client.embedColour(message)); - - var elapsedTime = client.music.getGuild(message.guild.id).dispatcher.streamTime / 1000 - var totalDuration = queue[0].duration - elapsedTime; + const q = queue.slice(start) - let timeRemaining = ""; - - for(let i = 1; i < queue.length; i++) { - let b = queue[i]; + let i = 0 - if(b.duration == 0) { - timeRemaining = "∞"; + for (i = 0; i < q.length; i++) { + const song = q[i] - break; - } + timestamp = createTimestamp(song.video.lengthSeconds) - totalDuration += b.duration; - } - - if(timeRemaining == "") { - let queueDuration = client.createTimestamp(totalDuration); + const aaa = list + `\`${(i + 1) + start - 1}:\` **[${song.video.title}](https://www.youtube.com/watch?v=${song.video.videoId})** added by ${song.requestedBy} \`[${timestamp}]\`\n` - timeRemaining = queueDuration; - } - - let timestamp; - - if(queue[0].duration == 0) { - timestamp = "LIVE"; - livestream = true; - } else { - timestamp = client.createTimestamp(elapsedTime) + '/' + client.createTimestamp(queue[0].duration); - }; - - embed.addField(`Now playing:`, `**[${queue[0].title}](https://www.youtube.com/watch?v=${queue[0].id})** added by ${queue[0].requestedBy} \`[${timestamp}]\``) - - embed.addField(`Up next:`, list); - - if(songsInQueue > 1 || songsInQueue == 0) { - songsInQueueEnglish = "songs"; - } - - embed.setFooter(`Page ${page}/${lists.length} | ${songsInQueue + " " + songsInQueueEnglish} in queue | ${timeRemaining} time remaining`); - - return embed; - }; - - var myMessage = null; - - function displayPage(number) { - let page = generatePage(lists[number - 1], number); - - if(page) { - if(myMessage) { - myMessage.edit(page); + if (aaa.length > 1024) { + return [list, start + i - 1] } else { - myMessage = message.channel.send(page); + list = aaa } - return true; - } else { - return false; + // totalDuration = totalDuration + song.duration } - }; - function aFunction(start) { + return [list, start + i + 1] + } + + const songsInQueue = queue.length - 1 + let songsInQueueEnglish = 'song' + + function generatePage (list, page) { + if (!list || list === '') { + return false + } + + var embed = new Discord.MessageEmbed() + embed.setTitle(`Queue for: ${message.guild.name}`) + embed.setColor(client.embedColour(message)) + + var elapsedTime = getGuild(message.guild.id).dispatcher.streamTime / 1000 + var totalDuration = queue[0].video.lengthSeconds - elapsedTime + + let timeRemaining = '' + + for (let i = 1; i < queue.length; i++) { + const b = queue[i] + + if (b.video.lengthSeconds === 0) { + timeRemaining = '∞' + + break + } + + totalDuration += b.video.lengthSeconds + } + + if (timeRemaining === '') { + const queueDuration = createTimestamp(totalDuration) + + timeRemaining = queueDuration + } + + let timestamp = `\`${createTimestamp(queue[0].video.lengthSeconds)}\`` + + if (timestamp !== '`[LIVE]`') { + timestamp = `\`[${createTimestamp(elapsedTime) + '/' + createTimestamp(queue[0].video.lengthSeconds)}]\`` + } + + embed.addField('Now playing:', `**[${queue[0].video.title}](https://www.youtube.com/watch?v=${queue[0].video.videoId})** added by ${queue[0].requestedBy} ${timestamp}`) + + embed.addField('Up next:', list) + + if (songsInQueue > 1 || songsInQueue === 0) { + songsInQueueEnglish = 'songs' + } + + embed.setFooter(`Page ${page}/${lists.length} | ${songsInQueue + ' ' + songsInQueueEnglish} in queue | ${timeRemaining} time remaining`) + + return embed + } + + var myMessage = null + + function displayPage (number) { + const page = generatePage(lists[number - 1], number) + + if (page) { + if (myMessage) { + myMessage.edit(page) + } else { + myMessage = message.channel.send(page) + } + + return true + } else { + return false + } + } + + function aFunction (start) { // start - index of song, which we should start with // end - index of song, which we ended with - let [list, end] = generateList(start, lists.length + 1); + const [list, end] = generateList(start, lists.length + 1) - if(list && list != "") { - lists.push(list); - - if(queue[end + 1]) { - aFunction(end + 1); + if (list && list !== '') { + lists.push(list) + + if (queue[end + 1]) { + aFunction(end + 1) } } - }; + } - aFunction(1); + aFunction(1) - let page = 1; + let page = 1 - if(args[0]) { - let userPage = Number(args[0]); + if (args[0]) { + const userPage = Number(args[0]) - if(userPage) { - page = userPage; + if (userPage) { + page = userPage } else { return message.channel.send( - `<:error:466995152976871434> Invalid page. Usage: \`${client.commands.get(`queue`).help.usage}\`` - ); + `<:error:466995152976871434> Invalid page number. Usage: \`${client.commands.get('queue').help.usage}\`` + ) } - }; + } - if(displayPage(page)) { + if (displayPage(page)) { } else { return message.channel.send( `<:error:466995152976871434> Page ${page} doesn't exist!` - ); + ) } -}; +} exports.conf = { enabled: true, diff --git a/src/commands/removesong.js b/src/commands/removesong.js index d576c7d..357720f 100644 --- a/src/commands/removesong.js +++ b/src/commands/removesong.js @@ -1,36 +1,30 @@ -const util = require("util") -const Discord = require("discord.js") - +const { getGuild } = require('../modules/music') module.exports.run = (client, message, args, level) =>{ - var queue = client.music.getGuild(message.guild.id).queue; + var queue = getGuild(message.guild.id).queue - if(queue.length < 2) { - return message.channel.send(`<:error:466995152976871434> Not enough songs are in the queue for this command to work!`); + if (queue.length < 2) { + return message.channel.send('<:error:466995152976871434> Not enough songs are in the queue for this command to work!') } - if(!args[0]) { - return message.channel.send(`<:error:466995152976871434> You didn't tell me what song to remove! Usage: \`${client.commands.get(`removesong`).help.usage}\``); - }; + if (!args[0]) { + return message.channel.send(`<:error:466995152976871434> You didn't tell me what song to remove! Usage: \`${client.commands.get('removesong').help.usage}\``) + } - var input = +args[0]; + var input = +args[0] - if(isNaN(input) == true) { - return message.channel.send(`<:error:466995152976871434> That isn't a number! You need to tell me the songs position in the queue (1, 2, etc.)`); - }; + if (isNaN(input) === true) { + return message.channel.send('<:error:466995152976871434> That isn\'t a number! You need to tell me the songs position in the queue (1, 2, etc.)') + } - if(input >= queue.length) { - return message.channel.send("Invalid (too large)"); - }; + if (input >= queue.length || input < 1) { + return message.channel.send('<:error:466995152976871434> Input is not a valid song ID.') + } - if(input < 1) { - return message.channel.send("Invalid (too small)"); - }; + var songName = queue[input].video.title - var songName = queue[input].title; + queue.splice(input, 1) - queue.splice(input, 1); - - message.channel.send(`<:success:466995111885144095> Removed from queue: **${songName}**`); + message.channel.send(`<:success:466995111885144095> Removed from queue: **${songName}**`) }; exports.conf = { @@ -38,7 +32,7 @@ exports.conf = { guildOnly: true, aliases: ["rmsong"], permLevel: "Moderator", - requiredPerms: ["SPEAK"] + requiredPerms: [] }; exports.help = { diff --git a/src/commands/resume.js b/src/commands/resume.js index 9c63f87..051cdfc 100644 --- a/src/commands/resume.js +++ b/src/commands/resume.js @@ -1,15 +1,20 @@ -const Discord = require("discord.js") +const { getGuild } = require('../modules/music') exports.run = (client, message, args, level) => { - let guild = client.music.getGuild(message.guild.id); - if(guild.queue.length < 1) { - return message.channel.send("<:error:466995152976871434> Nothing is playing."); - }; - guild.playing = true; - guild.paused = false; - guild.dispatcher.resume(); - message.channel.send("<:play:467216788187512832> Playback resumed!"); + const guild = getGuild(message.guild.id) + if (guild.paused === false) { + return message.channel.send('<:error:466995152976871434> The music is already playing, use pause to pause the music first!') + } + if (guild.queue.length < 1) { + return message.channel.send('<:error:466995152976871434> Nothing is playing!') + } + + guild.playing = true + guild.paused = false + guild.dispatcher.resume() + + message.channel.send('<:success:466995111885144095> Music playback has been resumed.') }; exports.conf = { diff --git a/src/commands/skip.js b/src/commands/skip.js index e62db40..35ee02f 100644 --- a/src/commands/skip.js +++ b/src/commands/skip.js @@ -1,49 +1,50 @@ -const Discord = require("discord.js") +const { skip, getGuild } = require('../modules/music') exports.run = (client, message, args, level) => { - let guild = client.music.getGuild(message.guild.id); + const guild = getGuild(message.guild.id) - if(guild.queue.length < 1 || !guild.playing || !guild.dispatcher) return message.channel.send( - "<:error:466995152976871434> Nothing is playing." - ); - - let vc = message.guild.members.cache.get(client.user.id).voice.channel; - - if(vc != message.member.voice.channel) return message.channel.send( - '<:error:466995152976871434> You need to be in my voice channel to use this command!' - ); - - if(guild.queue[0].requestedBy.id == message.author.id) { - skip_song(guild); - - message.channel.send( - `<:skip:467216735356059660> Song has been skipped by the user who requested it.` - ); - - return; + if (guild.queue.length < 1 || !guild.playing || !guild.dispatcher) { + return message.channel.send( + '<:error:466995152976871434> Nothing is playing.' + ) } - if (guild.skippers.indexOf(message.author.id) == -1) { - guild.skippers.push(message.author.id); + const vc = message.guild.members.cache.get(client.user.id).voice.channel + + if (vc !== message.member.voice.channel) { + return message.channel.send( + '<:error:466995152976871434> You need to be in my voice channel to use this command!' + ) + } + + if (guild.queue[0].requestedBy.id === message.author.id) { + skip(message.guild, 'skip') + + message.channel.send( + '<:success:466995111885144095> Song has been skipped by the user who requested it.' + ) + + return + } + + if (guild.skippers.indexOf(message.author.id) === -1) { + guild.skippers.push(message.author.id) if (guild.skippers.length >= Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)) { - - skip_song(guild); + skip(message.guild, 'skip') message.channel.send( - `<:skip:467216735356059660> Song has been skipped.` - ); - + '<:skip:467216735356059660> Song skipped.' + ) } else { message.channel.send( - `<:success:466995111885144095> Your vote has been acknowledged! **${guild.skippers.length + "/" + Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)}**` - ); + `<:success:466995111885144095> Your vote has been acknowledged! **${guild.skippers.length + '/' + Math.ceil(vc.members.filter(member => !member.user.bot).size / 2)}**` + ) }; - } else { message.channel.send( - "<:denied:466995195150336020> You cannot vote twice!" - ); - }; + '<:denied:466995195150336020> You cannot vote twice!' + ) + } }; exports.conf = { @@ -51,7 +52,7 @@ exports.conf = { guildOnly: true, aliases: ["voteskip"], permLevel: "User", - requiredPerms: ["SPEAK"] + requiredPerms: [] }; exports.help = { diff --git a/src/commands/stop.js b/src/commands/stop.js index 695dd04..b36b2a1 100644 --- a/src/commands/stop.js +++ b/src/commands/stop.js @@ -1,18 +1,18 @@ -const Discord = require("discord.js"); - +const { getGuild } = require('../modules/music') exports.run = async (client, message) => { - let guild = client.music.getGuild(message.guild.id); + const guild = getGuild(message.guild.id) - if(guild.queue.length < 1 || !guild.playing || !guild.dispatcher) return message.channel.send("<:error:466995152976871434> Nothing is playing."); - if(!message.member.voice.channel) return message.channel.send('<:error:466995152976871434> You need to be in voice channel to use this command!'); + if (guild.queue.length < 1 || !guild.playing || !guild.dispatcher) return message.channel.send('Nothing is playing.') + if (!message.member.voice.channel) return message.channel.send('You need to be in voice channel to use this command!') - guild.playing = false; - guild.paused = false; - guild.queue = []; + guild.dispatcher.end('silent') - guild.dispatcher.end("silent"); + guild.queue = [] + guild.playing = false + guild.paused = false + guild.skippers = [] - message.channel.send("<:stop:467639381390262284> Playback stopped!"); + message.channel.send('<:success:466995111885144095> Playback stopped!') }; exports.conf = { From 6d608455464b130cbe947b96bbc7d30584da55e4 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 14:06:15 +1000 Subject: [PATCH 019/110] new music module --- src/modules/music.js | 246 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 src/modules/music.js diff --git a/src/modules/music.js b/src/modules/music.js new file mode 100644 index 0000000..a3bb99e --- /dev/null +++ b/src/modules/music.js @@ -0,0 +1,246 @@ +// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license. + +const ytdl = require('ytdl-core-discord') +const fetch = require('node-fetch') +const { MessageEmbed } = require('discord.js') +const { utc } = require('moment') + +exports.queue = {} + +exports.createTimestamp = function (s) { + if (s < 1) { + return 'LIVE' + } else if (s >= 3600) { + return utc(s * 1000).format('HH:mm:ss') + } else { + return utc(s * 1000).format('mm:ss') + } +} + +exports.getGuild = function (id) { + let guild = exports.queue[id] + + if (!guild) { + guild = {} + + guild.queue = [] + guild.playing = false + guild.paused = false + guild.dispatcher = null + guild.skippers = [] + + exports.queue[id] = guild + } + + return guild +} + +exports.getLinkFromID = function (id) { + return 'https://www.youtube.com/watch?v=' + id +} + +exports.getVideoByQuery = async function (client, query, message) { + let res + + try { + const id = await ytdl.getURLVideoID(query) + res = await fetch(`${client.config.endpoints.invidious}v1/videos/${id}`) + } catch (err) { + res = await fetch(`${client.config.endpoints.invidious}v1/search?q=${encodeURIComponent(query)}`) + } + + const parsed = await res.json().catch(function (e) { + return message.channel.send('<:error:466995152976871434> An error has occured: ' + e) + }) + + if (parsed) { + const videos = parsed + if (videos) { + return videos + } else { + return false + } + } else { + return false + } +} + +exports.play = async function (client, message, query, playNext, ignoreQueue) { + const guild = exports.getGuild(message.guild.id) + guild.message = message + + message.channel.startTyping() + + if (!message.member.voice.channel && !guild.voiceChannel) { + message.channel.stopTyping() + return message.channel.send('<:error:466995152976871434> You have to be connected to a voice channel to use this command!') + } + + const vc = message.member.voice.channel + + let video + let videos + + if (!ignoreQueue) { + videos = await exports.getVideoByQuery(client, query, message) + if (!videos[1]) { + if (!videos[0]) { + video = videos + message.channel.stopTyping() + } else { + video = videos[0] + } + } + } + + if (videos || ignoreQueue) { + if (!ignoreQueue) { + // Fix the bot if somehow broken + // music "playing", nothing in queue + if ((guild.playing || guild.dispatcher) && guild.queue.length === 0) { + guild.queue = [] + guild.playing = false + guild.paused = false + guild.skippers = [] + // music not playing, something is in queue + } else if (!guild.playing && !guild.dispatcher && guild.queue.length > 0) { + guild.queue = [] + } + + if (!video) { + let output = '' + let i = 0 + for (i = 0; i < 5; i++) { + if (!videos[i]) break + output += `\`${i + 1}:\` **[${videos[i].title}](https://www.youtube.com/watch?v=${videos[i].videoId})** \`[${exports.createTimestamp(videos[i].lengthSeconds)}]\`\n` + } + + message.channel.stopTyping() + const embed = new MessageEmbed() + embed.setTitle('Please reply with a number `1-' + i + '` to select which song you want to add to the queue.') + embed.setColor(client.embedColour(message)) + embed.setDescription(output) + + let selection = await client.awaitReply(message, embed) + selection = Number(selection) + + switch (selection) { + case 1: + video = videos[0] + break + case 2: + if (videos[1]) { + video = videos[1] + } else { + return message.channel.send('<:error:466995152976871434> Invalid choice.') + } + break + case 3: + if (videos[2]) { + video = videos[2] + } else { + return message.channel.send('<:error:466995152976871434> Invalid choice.') + } + break + case 4: + if (videos[3]) { + video = videos[3] + } else { + return message.channel.send('<:error:466995152976871434> Invalid choice.') + } + break + case 5: + if (videos[4]) { + video = videos[4] + } else { + return message.channel.send('<:error:466995152976871434> Invalid choice.') + } + break + default: + return message.channel.send('<:error:466995152976871434> Invalid choice.') + } + } + + if (!video && videos[0]) { + video = videos[0] + } else if (!video) { + video = videos + } + + // Add video to queue + if (playNext === true) { + guild.queue.splice(1, 0, { video: video, requestedBy: message.author }) + } else { + guild.queue.push({ video: video, requestedBy: message.author }) + } + } + + // Figure out if the bot should add it to queue or play it right now + if (guild.playing) { + message.channel.send('<:success:466995111885144095> Queued **' + video.title + '** `[' + exports.createTimestamp(video.lengthSeconds) + ']`') + } else { + guild.playing = true + + guild.voiceChannel = vc + + if (!guild.channel) { + guild.channel = message.channel + } + + const connection = await vc.join() + + const v = guild.queue[0] + + try { + guild.dispatcher = connection.play(await ytdl(exports.getLinkFromID(v.video.videoId), { highWaterMark: 1024 * 1024 * 32 }), { type: 'opus' }) + } catch (err) { + if (playNext && playNext === true) { + guild.queue.splice(1, 1) + } else { + 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}\``) + } + 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.once('finish', () => { + guild.queue.shift() + guild.playing = false + + if (guild.queue.length > 0) { + exports.play(client, message, null, false, true) + } else { + guild.queue = [] + guild.playing = false + guild.paused = false + guild.skippers = [] + + connection.disconnect() + } + }) + } + } else { + return message.channel.channelsend('failed to find the video!') + } +} + +exports.setVolume = function (guild, target) { + const g = exports.getGuild(guild.id) + + if (g.dispatcher) { + g.dispatcher.setVolume(target) + } +} + +exports.skip = function (guild, reason) { + const g = exports.getGuild(guild.id) + + if (g.dispatcher) { + g.dispatcher.end(reason) + } +} From 0b8c4ec38dd8e26f388b822486e54c2ab5293eb5 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 14:06:41 +1000 Subject: [PATCH 020/110] player monitor to hopefully help music break less --- src/events/voiceStateUpdate.js | 42 ++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/events/voiceStateUpdate.js diff --git a/src/events/voiceStateUpdate.js b/src/events/voiceStateUpdate.js new file mode 100644 index 0000000..5b40a54 --- /dev/null +++ b/src/events/voiceStateUpdate.js @@ -0,0 +1,42 @@ +// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license. + +const music = require('../modules/music') + +module.exports = (client, oldState, newState) => { + if (newState.channelID !== oldState.channelID) { + const guild = music.getGuild(newState.guild.id) + + // Reset queue, dispatcher, etc if Woomy is forcibly disconnected from the queue + if (guild.voiceChannel && !guild.voiceChannel.members.get(client.user.id) && guild.queue.length > 0) { + guild.queue = [] + guild.playing = false + guild.paused = false + guild.skippers = [] + } + + // Auto-disconnect feature + if (guild.playing && guild.channel && guild.voiceChannel.id === oldState.channelID) { + if (guild.voiceChannel.members.filter(member => !member.user.bot).size < 1) { + guild.message.channel.send('Everyone has left my voice channel, the music will end in two minutes if no one rejoins.') + .then(msg => { + msg.delete({ timeout: 120000 }) + }) + + setTimeout(() => { + if (guild.dispatcher !== null && guild.voiceChannel.members.filter(member => !member.user.bot).size < 1) { + // Probably should be async? But no need here I think + guild.dispatcher.end('silent') + + guild.queue = [] + guild.playing = false + guild.paused = false + guild.dispatcher = null + guild.skippers = [] + + guild.message.channel.send('The music has ended because no one was listening to me ;~;') + } + }, 120000) + } + } + } +} From 42df6b71c7f9c0a86aba5a9be221a8687cd14446 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 14:11:02 +1000 Subject: [PATCH 021/110] backport new ship command --- src/commands/ship.js | 72 ++++++++++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/src/commands/ship.js b/src/commands/ship.js index 3850d87..cd62b5d 100644 --- a/src/commands/ship.js +++ b/src/commands/ship.js @@ -1,40 +1,54 @@ +const Discord = require('discord.js') exports.run = async (client, message, args) => { - - var name, name1; - var rating = Math.floor(Math.random() * 100) + 1; + var rating = Math.floor(Math.random() * 100) + 1 + var meter = ['▬', '▬', '▬', '▬', '▬', '▬', '▬', '▬', '▬'] var hearts = [ - "❤️", - "🧡", - "💛", - "💚", - "💙", - "💜" - ]; - - if(args.length < 2) { - return message.channel.send(`<:error:466995152976871434> Please include two names/users.`) + '❤️', + '🧡', + '💛', + '💚', + '💙', + '💜' + ] + + if (!args[0]) { + return message.channel.send(client.userError(exports, 'Missing argument, the `name1` argument is required!')) } - if(message.guild && message.mentions.members && message.mentions.members.size > 0) { - name = message.mentions.members.first().displayName; - }; + if (!args[1]) { + return message.channel.send(client.userError(exports, 'Missing argument, the `name2` argument is required!')) + } - if(message.guild && message.mentions.members && message.mentions.members.size > 1) { - name1 = message.mentions.members.last().displayName; - }; + const firstName = args[0] + const secondName = args[1] - if(!name) { - name = args[0]; - }; + const shipName = firstName.substr(0, firstName.length * 0.5) + secondName.substr(secondName.length * 0.5) - if(!name1) { - name1 = args[1]; - }; + if (shipName.toLowerCase() === 'teily' || shipName.toLowerCase() === 'emrra') { + rating = '100' + } - shipName = name.substr(0, client.intBetween(1,name.length))+name1.substr(client.intBetween(0,name1.length)); + var pos = 0 + var under = 9 + while (pos < 10) { + if (rating < under) { + meter.splice(pos, 0, hearts.random()) + break + } + pos++ + under += 10 + } - message.channel.send(`__**Ship Generator:**__\n${hearts.random()} Ship Name: \`${shipName}\`\n${hearts.random()} Compatibility rating: \`${rating}%\``) -}; + if (rating >= 99) { + meter.splice(9, 0, hearts.random()) + } + + const embed = new Discord.MessageEmbed() + embed.setTitle(`Original Names: ${firstName}, ${secondName}`) + embed.setColor(client.embedColour(message.guild)) + embed.setDescription(`Ship Name: **${shipName}**\nCompatibility: **${rating}%**\n**[**${meter.join('')}**]**`) + message.channel.send(embed) +} exports.conf = { enabled: true, @@ -48,6 +62,6 @@ exports.help = { name: "ship", category: "Fun", description: "Ship two people together <3", - usage: "ship [name/user] [name/user]" + usage: "ship [name1] [name2]" }; From 59084b07cb553788d045473db0f1bfa2bcf2b7a5 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 14:44:23 +1000 Subject: [PATCH 022/110] Add new music commands --- src/commands/fixmusic.js | 30 +++++++++++++++++++++ src/commands/movehere.js | 33 +++++++++++++++++++++++ src/commands/movesong.js | 56 +++++++++++++++++++++++++++++++++++++++ src/commands/playnext.js | 23 ++++++++++++++++ src/commands/shuffle.js | 34 ++++++++++++++++++++++++ src/commands/songinfo.js | 42 +++++++++++++++++++++++++++++ src/commands/volume.js | 57 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 275 insertions(+) create mode 100644 src/commands/fixmusic.js create mode 100644 src/commands/movehere.js create mode 100644 src/commands/movesong.js create mode 100644 src/commands/playnext.js create mode 100644 src/commands/shuffle.js create mode 100644 src/commands/songinfo.js create mode 100644 src/commands/volume.js diff --git a/src/commands/fixmusic.js b/src/commands/fixmusic.js new file mode 100644 index 0000000..387aa9f --- /dev/null +++ b/src/commands/fixmusic.js @@ -0,0 +1,30 @@ +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 = [] + + if (guild.dispatcher) { + guild.dispatcher.end('silent') + } + + message.channel.send('<:success:466995111885144095> Music has been fixed (hopefully)') +} + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: [], + permLevel: "Moderator", + requiredPerms: [] +}; + +exports.help = { + name: "fixmusic", + category: "Music", + description: 'Fixes music if it breaks.', + usage: 'fixmusic', +}; diff --git a/src/commands/movehere.js b/src/commands/movehere.js new file mode 100644 index 0000000..61ea0ee --- /dev/null +++ b/src/commands/movehere.js @@ -0,0 +1,33 @@ +const { getGuild } = require('../modules/music') +const Discord = require("discord.js") + +module.exports.run = async (client, message, args, level) =>{ + const guild = getGuild(message.guild.id) + + if (!guild.playing) { + return message.channel.send('<:error:466995152976871434> Nothing is playing.') + } + + if (guild.channel.id === message.channel.id) { + return message.channel.send('<:error:466995152976871434> Music messages are already being sent to this channel.') + } + + guild.channel = message.channel + + message.channel.send('<:success:466995111885144095> Music messages will now be sent to this channel.') +} + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: [], + permLevel: "Moderator", + requiredPerms: [] +}; + +exports.help = { + name: 'movehere', + category: 'Music', + description: 'Moves music related messages to the channel the this command is ran in.', + usage: 'movehere', +}; diff --git a/src/commands/movesong.js b/src/commands/movesong.js new file mode 100644 index 0000000..83c6a7c --- /dev/null +++ b/src/commands/movesong.js @@ -0,0 +1,56 @@ +const { getGuild } = require('../modules/music') +exports.run = async (client, message, args) => { + const queue = getGuild(message.guild.id).queue + + if (queue.length < 3) { + return message.channel.send('<:error:466995152976871434> Not enough songs are in the queue for this command to work!') + } + + if (!args[0]) { + return client.userError(message, exports, 'Missing argument, the `current position` argument is required!') + } + + if (!args[1]) { + return client.userError(message, exports, 'Missing argument, the `new position` argument is required!') + } + + const oldPosition = +args[0] + const newPosition = +args[1] + + if (isNaN(oldPosition) === true) { + return message.channel.send('<:error:466995152976871434> That isn\'t a number! You need to tell me the songs position in the queue (1, 2, etc.)') + } + + if (isNaN(newPosition) === true) { + return message.channel.send('<:error:466995152976871434> That isn\'t a number! You need to tell me the songs position in the queue (1, 2, etc.)') + } + + if (oldPosition < 1 || oldPosition >= queue.length) { + return message.channel.send('<:error:466995152976871434> Old position is not a valid song ID.') + } + + if (newPosition < 1 || newPosition >= queue.length) { + return message.channel.send('<:error:466995152976871434> New position is not a valid song ID.') + } + + const songName = queue[oldPosition].video.title + + queue.splice(newPosition, 0, queue.splice(oldPosition, 1)[0]) + + message.channel.send(`<:success:466995111885144095> Moved **${songName}** from position \`${oldPosition}\` to \`${newPosition}\``) +} + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: [], + permLevel: "Moderator", + requiredPerms: [] +} + +exports.help = { + name: 'movesong', + category: 'Music', + description: 'Moves a song to a new position in the queue.', + usage: 'movesong [current position] [new position]' +} \ No newline at end of file diff --git a/src/commands/playnext.js b/src/commands/playnext.js new file mode 100644 index 0000000..6314283 --- /dev/null +++ b/src/commands/playnext.js @@ -0,0 +1,23 @@ +const { play } = require('../modules/music') +exports.run = async (client, message, args) => { + if (!args[0]) { + return message.channel.send(`<:error:466995152976871434> You didn't give me a song name or YouTube URL! Usage: \`${client.commands.get('play').help.usage}\``) + } + + await play(client, message, args.join(' '), true) +} + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: [], + permLevel: "Moderator", + requiredPerms: [] +} + +exports.help = { + name: 'playnext', + category: 'Music', + description: 'Similar to play, but adds it to the start of the queue instead of the end.', + usage: 'playnext [song]' +} \ No newline at end of file diff --git a/src/commands/shuffle.js b/src/commands/shuffle.js new file mode 100644 index 0000000..23270e5 --- /dev/null +++ b/src/commands/shuffle.js @@ -0,0 +1,34 @@ +const { getGuild } = require('../modules/music') +exports.run = async (client, message) => { + var queue = getGuild(message.guild.id).queue + + if (queue.length < 4) { + return message.channel.send('<:error:466995152976871434> There aren\'t enough songs are in the queue for this command to work!') + } + + const max = queue.length - 1 + const min = 1 + for (let i = max; i >= min; i--) { + const randomIndex = Math.floor(Math.random() * (max - min + 1)) + min + const itemAtIndex = queue[randomIndex] + queue[randomIndex] = queue[i] + queue[i] = itemAtIndex + } + + message.channel.send('<:success:466995111885144095> Queue shuffled!') +} + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: [], + permLevel: "Moderator", + requiredPerms: [] +} + +exports.help = { + name: 'shuffle', + category: 'Music', + description: 'Mixes up the songs in the queue', + usage: 'shuffle' +} \ No newline at end of file diff --git a/src/commands/songinfo.js b/src/commands/songinfo.js new file mode 100644 index 0000000..cd7bb0b --- /dev/null +++ b/src/commands/songinfo.js @@ -0,0 +1,42 @@ +const { getGuild, createTimestamp } = require('../modules/music') +const { MessageEmbed } = require('discord.js') +exports.run = async (client, message, args) => { + const guild = getGuild(message.guild.id) + + if (guild.queue.length < 1) { + return message.channel.send(client.config.emojis.error + ' Nothing is in the queue!') + } + + const songID = +args[0] + + if (isNaN(songID) === true) { + return message.channel.send('<:error:466995152976871434> That isn\'t a number! You need to tell me the songs position in the queue (1, 2, etc.)') + } + + const s = guild.queue[songID] + + const embed = new MessageEmbed() + embed.setThumbnail(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) + embed.addField('Length:', '`[' + createTimestamp(s.video.lengthSeconds) + ']`', true) + embed.setFooter('Requested by ' + s.requestedBy.tag, s.requestedBy.avatarURL({ format: 'png', dynamic: true, size: 2048 })) + + message.channel.send(embed) +} + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: [], + permLevel: "User", + requiredPerms: [] +} + +exports.help = { + name: "songinfo", + category: "Music", + description: "Sends you information about a song in the queue. Song ID is the song's position in the queue.", + usage: "songinfo [songID]" +} \ No newline at end of file diff --git a/src/commands/volume.js b/src/commands/volume.js new file mode 100644 index 0000000..6711947 --- /dev/null +++ b/src/commands/volume.js @@ -0,0 +1,57 @@ +const { getGuild, setVolume } = require('../modules/music') +exports.run = async (client, message, args) => { + if (!args[0]) { + return message.channel.send(`<:error:466995152976871434> No input! Usage: \`${client.commands.get('volume').help.usage}\``) + } + + const guild = getGuild(message.guild.id) + + if (guild.queue.length < 1 || !guild.playing || !guild.dispatcher) { + return message.channel.send( + '<:error:466995152976871434> Nothing is playing.' + ) + } + + let userVolume = args[0] + + if (userVolume.includes('%')) { + userVolume = userVolume.replace('%', '') + } + + userVolume = +userVolume + + if (isNaN(userVolume) === true) { + return message.channel.send('<:error:466995152976871434> Input must be a number!') + } + + if (userVolume > 100 || userVolume < 1) { + return message.channel.send('<:error:466995152976871434> Invalid input, input must be between 1-100') + } + + if (userVolume) { + userVolume = Number(userVolume) + + userVolume = userVolume / 100 + + if (userVolume <= 1) { + setVolume(message.guild, userVolume) + + message.channel.send('<:success:466995111885144095> Set volume to ' + userVolume * 100 + '%') + } + } +} + +exports.conf = { + enabled: true, + guildOnly: true, + aliases: [], + permLevel: "Moderator", + requiredPerms: [] +} + +exports.help = { + name: 'volume', + category: 'Music', + description: 'Sets volume of currently playing music. (100% = 25% of the actual volume)', + usage: 'volume [volume]' +} \ No newline at end of file From fef8c0e5b0ef72c8b5613e4d657f126627509014 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 30 Apr 2020 14:48:56 +1000 Subject: [PATCH 023/110] update changelog --- version.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.json b/version.json index a28546d..67e2097 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.2.4", - "changelog": "**1.2.0 CHANGELOG:**\n> • Added action commands! (`cuddle`, `feed`, `hug`, `kiss`, `pat`, `poke`, `slap`, `smug`, `tickle`)\n> • Added `fact`\n> • Added `catfact`\n> • Added `dogfact`\n> • Added `yoda`\n> • Added `dice`\n> • Added `spoilerise`\n> • Added `zalgo`\n> • Added `dog`\n> • Added `cat`\n> • Added `lizard`\n> • Added `neko`\n> • Added `nekogif`\n> • Added `kemonomimi`\n> • Added `foxgirl`\n> • Added `identity`\n> • Added `pronouns`\n> • Added `sexuality`\n> • Added `ship`\n> • Renamed `flip to `coinflip` (flip remains as an alias)\n> • Renamed `math` to `calculate` (math is an alias)\n> • @Woomy is now a prefix\n> • Added the `inspire` alias to `inspirobot`\n> • Help now displays the amount of commands in each category\n> • Bots now get a badge in `userinfo`\n> • `roleinfo` now displays what permissions a role has\n> • small changes to `weather`\n> • Woomy now has clear logging of issues that prevent her from starting\n> • request npm module has been swapped out for node-fetch\n**NOTES:**\n> Thank you to Terryiscool160 for creating multiple commands used in this update" + "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." } From bdbea2abb95e542f230a15b3119df0996a3edc95 Mon Sep 17 00:00:00 2001 From: IFcoltransG <47414286+IFcoltransG@users.noreply.github.com> Date: Sat, 2 May 2020 13:14:28 +1200 Subject: [PATCH 024/110] Spelling mistake in Bohemian Rhapsody description --- src/commands/bohemian_rhapsody.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/bohemian_rhapsody.js b/src/commands/bohemian_rhapsody.js index c9bb3ef..878b8e9 100644 --- a/src/commands/bohemian_rhapsody.js +++ b/src/commands/bohemian_rhapsody.js @@ -40,6 +40,6 @@ exports.conf = { exports.help = { name: "bohemian_rhapsody", category: "Fun", - description: "Queen kareoke", + description: "Queen karaoke", usage: "bohemian_rhapsody" }; From b2b5431ee4d36a623eb805c30b7c2e14afb2bcd7 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 2 May 2020 18:48:58 +1000 Subject: [PATCH 025/110] fixed bugs --- src/commands/say.js | 4 ++-- src/events/voiceStateUpdate.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/say.js b/src/commands/say.js index e196847..e63fc48 100644 --- a/src/commands/say.js +++ b/src/commands/say.js @@ -5,7 +5,7 @@ exports.run = (client, message, args, level) => { ); }; if (message.content.includes("@everyone")) { - return message.channel.send(`<@${message.author.id}>`); + return message.channel.send(message.author); }; message.delete().catch(O_o => {}); @@ -24,5 +24,5 @@ exports.help = { name: "say", category: "Fun", description: "Makes Woomy copy what the user says.", - usage: "echo <-hide> [message]" + usage: "echo [message]" }; diff --git a/src/events/voiceStateUpdate.js b/src/events/voiceStateUpdate.js index 5b40a54..34fd833 100644 --- a/src/events/voiceStateUpdate.js +++ b/src/events/voiceStateUpdate.js @@ -15,7 +15,7 @@ module.exports = (client, oldState, newState) => { } // Auto-disconnect feature - if (guild.playing && guild.channel && guild.voiceChannel.id === oldState.channelID) { + if (guild.playing && guild.voiceChannel && guild.voiceChannel.id === oldState.channelID) { if (guild.voiceChannel.members.filter(member => !member.user.bot).size < 1) { guild.message.channel.send('Everyone has left my voice channel, the music will end in two minutes if no one rejoins.') .then(msg => { From 40b9a4dd933f0585f05adc7c682afe6e6e6a0251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Mon, 4 May 2020 22:04:40 +0200 Subject: [PATCH 026/110] discordapp.com -> discord.com --- README.md | 2 +- src/commands/help.js | 4 ++-- src/commands/invite.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 693f553..530097c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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. # How to use -The easiest way to use Woomy is to invite it to your server with [this link.](https://discordapp.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. +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. Self hosting is generally not recommended, but instructions are provided below if you still wish to do so. Woomy's code will need to be modified before it will run on your machine. diff --git a/src/commands/help.js b/src/commands/help.js index 9ccb578..80fe504 100644 --- a/src/commands/help.js +++ b/src/commands/help.js @@ -50,7 +50,7 @@ exports.run = (client, message, args, level) => { embed.addField( "Invite me", - "[Click here](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your server", + "[Click here](https://discord.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your server", true ); embed.addField( @@ -97,7 +97,7 @@ exports.run = (client, message, args, level) => { embed.addField( "Invite me", - "[Click here](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your server", + "[Click here](https://discord.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your server", true ); embed.addField( diff --git a/src/commands/invite.js b/src/commands/invite.js index 49cdc86..a730eb6 100644 --- a/src/commands/invite.js +++ b/src/commands/invite.js @@ -1,6 +1,6 @@ exports.run = async (client, message) => { message.channel.send( - `Use this link to invite me to your server:\n` + `Use this link to invite me to your server:\n` ); }; From b6b810b4de38fd6b4e75bd1c5d71860e5087c756 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 9 May 2020 16:43:30 +1000 Subject: [PATCH 027/110] fixed skip + rate --- src/commands/rate.js | 5 +++++ src/modules/music.js | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/commands/rate.js b/src/commands/rate.js index d4f0eac..64ded10 100644 --- a/src/commands/rate.js +++ b/src/commands/rate.js @@ -16,6 +16,11 @@ var rating = [ "9/10", "10/10" ]; + +if (message.content.includes("@everyone")) { + return message.channel.send('>:('); +} + let mess = rating.random(); message.channel.send(`<:star:618393201501536258> I give ${args.join(" ")} a **${mess}**`); }; diff --git a/src/modules/music.js b/src/modules/music.js index a3bb99e..d5b5d86 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -240,6 +240,8 @@ exports.setVolume = function (guild, target) { exports.skip = function (guild, reason) { const g = exports.getGuild(guild.id) + g.skippers = [] + if (g.dispatcher) { g.dispatcher.end(reason) } From e633c6b65a0c5e08f0a54329404da0c4e0d0be6b Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 9 May 2020 16:47:06 +1000 Subject: [PATCH 028/110] update version --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 67e2097..f09800b 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.0", + "number": "1.3.1", "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." } From 7c33e44e00abbb1e95a2c25c3dbbe17ddb548a1b Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 9 May 2020 16:48:25 +1000 Subject: [PATCH 029/110] disable typing for music --- src/modules/music.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/music.js b/src/modules/music.js index d5b5d86..7e3083e 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -69,7 +69,7 @@ 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() @@ -240,9 +240,7 @@ exports.setVolume = function (guild, target) { exports.skip = function (guild, reason) { const g = exports.getGuild(guild.id) - g.skippers = [] - if (g.dispatcher) { g.dispatcher.end(reason) } -} +} \ No newline at end of file From 63f5dbc6d38250e91d6680a917811c9983b3478a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Tue, 12 May 2020 10:41:48 +0200 Subject: [PATCH 030/110] message.content: Remove zero-width characters. --- src/events/message.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/events/message.js b/src/events/message.js index 465ce3f..e06bfd2 100644 --- a/src/events/message.js +++ b/src/events/message.js @@ -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) { From ebc0b198f0597063abcf2671d23e30f31bec613e Mon Sep 17 00:00:00 2001 From: agentdoesnotexist Date: Thu, 7 May 2020 20:49:40 +1000 Subject: [PATCH 031/110] Fixed typo --- src/modules/music.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index 7e3083e..e7f30eb 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -225,7 +225,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { }) } } else { - return message.channel.channelsend('failed to find the video!') + return message.channel.send('failed to find the video!') } } From ac5d3dc78c4a971c9e322a53fac0b054ef528670 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Fri, 22 May 2020 12:16:57 +1000 Subject: [PATCH 032/110] bot can no longer use @here --- src/commands/rate.js | 2 +- src/commands/say.js | 4 ++-- version.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/rate.js b/src/commands/rate.js index 64ded10..31e05dd 100644 --- a/src/commands/rate.js +++ b/src/commands/rate.js @@ -17,7 +17,7 @@ var rating = [ "10/10" ]; -if (message.content.includes("@everyone")) { +if (message.content.includes("@everyone") || message.content.includes("@here")) { return message.channel.send('>:('); } diff --git a/src/commands/say.js b/src/commands/say.js index e63fc48..a6c3cca 100644 --- a/src/commands/say.js +++ b/src/commands/say.js @@ -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")) { + return message.channel.send('>:('); }; message.delete().catch(O_o => {}); diff --git a/version.json b/version.json index f09800b..a0e07a1 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.1", + "number": "1.3.2", "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." } From dddaeba8e3b0106b6fb3229a3d39b32e24ff9441 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 28 May 2020 17:52:15 +1000 Subject: [PATCH 033/110] fixmusic can be used by users, invidious issues --- src/commands/fixmusic.js | 53 ++++++++++++++++++++++++++++++++++------ src/commands/stop.js | 1 + src/modules/music.js | 8 ++++-- 3 files changed, 52 insertions(+), 10 deletions(-) diff --git a/src/commands/fixmusic.js b/src/commands/fixmusic.js index 387aa9f..e7c1171 100644 --- a/src/commands/fixmusic.js +++ b/src/commands/fixmusic.js @@ -2,23 +2,60 @@ 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 >= 1) { + guild.queue = [] + guild.playing = false + guild.paused = false + guild.skippers = [] + guild.fixers = [] + + if (guild.dispatcher) { + guild.dispatcher.end('silent') + } + + message.channel.send( + '<:success:466995111885144095> Music has been fixed!' + ) + + return } - message.channel.send('<:success:466995111885144095> Music has been fixed (hopefully)') + 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 = [] + + if (guild.dispatcher) { + guild.dispatcher.end('silent') + } + + 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: [] }; diff --git a/src/commands/stop.js b/src/commands/stop.js index b36b2a1..4f732ff 100644 --- a/src/commands/stop.js +++ b/src/commands/stop.js @@ -11,6 +11,7 @@ exports.run = async (client, message) => { guild.playing = false guild.paused = false guild.skippers = [] + guild.fixers = [] message.channel.send('<:success:466995111885144095> Playback stopped!') }; diff --git a/src/modules/music.js b/src/modules/music.js index e7f30eb..2eb3b5d 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -28,6 +28,7 @@ exports.getGuild = function (id) { guild.paused = false guild.dispatcher = null guild.skippers = [] + guild.fixers = [] exports.queue[id] = guild } @@ -102,6 +103,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { guild.playing = false guild.paused = false guild.skippers = [] + guild.fixers = [] // music not playing, something is in queue } else if (!guild.playing && !guild.dispatcher && guild.queue.length > 0) { guild.queue = [] @@ -200,8 +202,9 @@ 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('(YT API change, disregard) ' + err) + // return message.channel.send(`<:error:466995152976871434> An error has occured! If this issue persists, please contact my developers with this:\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) @@ -219,6 +222,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { guild.playing = false guild.paused = false guild.skippers = [] + guild.fixers = [] connection.disconnect() } From 7a1964fb4ca39de494b2f599319b2929bda04dbd Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 30 May 2020 13:55:04 +1000 Subject: [PATCH 034/110] pride update cause i couldn't wait until june --- src/commands/pride.js | 48 +++++++++++++++++++++++++++++++++++++++++++ src/modules/music.js | 4 ++-- version.json | 2 +- 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 src/commands/pride.js diff --git a/src/commands/pride.js b/src/commands/pride.js new file mode 100644 index 0000000..92ec057 --- /dev/null +++ b/src/commands/pride.js @@ -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 client.userError(message, exports, '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}\``) + } +} \ No newline at end of file diff --git a/src/modules/music.js b/src/modules/music.js index 2eb3b5d..6c9d811 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -203,8 +203,8 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { } client.logger.error('(YT API change, disregard) ' + err) - // return message.channel.send(`<:error:466995152976871434> An error has occured! If this issue persists, please contact my developers with this:\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.') + 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) diff --git a/version.json b/version.json index a0e07a1..c095bb6 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.2", + "number": "1.3.3", "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." } From 47f163dcab6fa24fdad01d97d4bdf1b1e0d140e8 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 30 May 2020 13:59:50 +1000 Subject: [PATCH 035/110] forgot to remove stuff from v2 --- src/commands/pride.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/pride.js b/src/commands/pride.js index 92ec057..6a7abfc 100644 --- a/src/commands/pride.js +++ b/src/commands/pride.js @@ -20,7 +20,7 @@ const Discord = require('discord.js') exports.run = (client, message, args) => { const flag = args[0] if (!flag) { - return client.userError(message, exports, 'Missing argument, the `flag` argument is required!') + return message.channel.send('<:error:466995152976871434> Missing argument, the `flag` argument is required!') } const available = ['lesbian', 'gay', 'bisexual', 'pansexual', 'trans', 'asexual', 'aromantic', 'ally'] From d585ffa45c81ce39a07cc5a7e08b3d0e65f0ee29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 09:57:46 +0200 Subject: [PATCH 036/110] fix music fixer inside of play function --- src/modules/music.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/music.js b/src/modules/music.js index 6c9d811..fe4f618 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -69,7 +69,7 @@ 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() if (!message.member.voice.channel && !guild.voiceChannel) { @@ -105,7 +105,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { guild.skippers = [] guild.fixers = [] // 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 = [] } From 8575fb7906e0e37516eeb90249a8c872da3d7809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:07:27 +0200 Subject: [PATCH 037/110] log music dispatcher errors --- src/modules/music.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/music.js b/src/modules/music.js index fe4f618..6a44857 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -211,6 +211,8 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { 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', console.error); + guild.dispatcher.once('finish', () => { guild.queue.shift() guild.playing = false From 8de3c6ccade29ed43c766d06f2859fe3e30a4a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:14:56 +0200 Subject: [PATCH 038/110] Music debugs, cant reproduce locally --- src/modules/music.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index 6a44857..763d643 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -189,13 +189,23 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { guild.channel = message.channel } + console.log('[MUSIC DEBUG] joining vc'); + const connection = await vc.join() + console.log('[MUSIC DEBUG] joined vc'); + const v = guild.queue[0] + console.log('[MUSIC DEBUG] got v'); + try { guild.dispatcher = connection.play(await ytdl(exports.getLinkFromID(v.video.videoId), { highWaterMark: 1024 * 1024 * 32 }), { type: 'opus' }) + + console.log('[MUSIC DEBUG] got dispatcher') } catch (err) { + console.error(err); + if (playNext && playNext === true) { guild.queue.splice(1, 1) } else { @@ -206,14 +216,20 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { 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.') } + console.log('[MUSIC DEBUG] setting volume'); guild.dispatcher.setVolume(0.25) + console.log('[MUSIC DEBUG] set volume'); 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', console.error); + guild.dispatcher.on('error', (err) => { + console.error('[MUSIC ERROR] ' + String(err)); + }); guild.dispatcher.once('finish', () => { + console.log('[MUSIC DEBUG] dispatcher finish'); + guild.queue.shift() guild.playing = false From feab4749b36e9f2149e5d29f721a515dfa4639e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:18:53 +0200 Subject: [PATCH 039/110] more debug --- src/modules/music.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/modules/music.js b/src/modules/music.js index 763d643..036b71e 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -200,9 +200,18 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { console.log('[MUSIC DEBUG] got v'); try { - guild.dispatcher = connection.play(await ytdl(exports.getLinkFromID(v.video.videoId), { highWaterMark: 1024 * 1024 * 32 }), { type: 'opus' }) + console.log('[MUSIC DEBUG] getting link'); + let link = exports.getLinkFromID(v.video.videoId); + console.log('[MUSIC DEBUG] got link: ' + (message.guild.id == '410990517841690625' ? link : 'not woomy server')); - console.log('[MUSIC DEBUG] got dispatcher') + console.log('[MUSIC DEBUG] await ytdl'); + let y = await ytdl(link, { highWaterMark: 1024 * 1024 * 32 }); + console.log('[MUSIC DEBUG] got ytdl'); + + console.log('[MUSIC DEBUG] connection.play'); + guild.dispatcher = connection.play(y, { type: 'opus' }); + + console.log('[MUSIC DEBUG] got dispatcher'); } catch (err) { console.error(err); From 52197a939e98c1c73afa551c863615e5cd88c258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:22:10 +0200 Subject: [PATCH 040/110] remove watermark and see if it works --- src/modules/music.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index 036b71e..91bcd95 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -204,8 +204,16 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { let link = exports.getLinkFromID(v.video.videoId); console.log('[MUSIC DEBUG] got link: ' + (message.guild.id == '410990517841690625' ? link : 'not woomy server')); + let y = null; + + setTimeout(() => { + if(y == null) { + console.log('[MUSIC DEBUG] y is still null'); + }; + }, 5000); + console.log('[MUSIC DEBUG] await ytdl'); - let y = await ytdl(link, { highWaterMark: 1024 * 1024 * 32 }); + y = await ytdl(link); console.log('[MUSIC DEBUG] got ytdl'); console.log('[MUSIC DEBUG] connection.play'); From 07c9972ce0dd5325001f4c6741df3770d100ed47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:24:22 +0200 Subject: [PATCH 041/110] use git version of ytdl-core-discord --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 73e312c..77bda62 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", - "ytdl-core-discord": "^1.2.0" + "ytdl-core-discord": "github:amishshah/ytdl-core-discord" }, "devDependencies": {}, "scripts": { From a155b7dde73a29edac070cf407c4048039f83d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:24:35 +0200 Subject: [PATCH 042/110] add back highwatermark --- src/modules/music.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index 91bcd95..8443e30 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -213,7 +213,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { }, 5000); console.log('[MUSIC DEBUG] await ytdl'); - y = await ytdl(link); + y = await ytdl(link, { highWaterMark: 1024 * 1024 * 32 }); console.log('[MUSIC DEBUG] got ytdl'); console.log('[MUSIC DEBUG] connection.play'); From de956b5197d249c2199b498ec958e20dba68d998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:37:13 +0200 Subject: [PATCH 043/110] use invidious for music instead of youtube --- package.json | 1 + src/modules/music.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 77bda62..413377b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", + "ytdl-core": "github:FLGX06/node-ytdl-core#invidious", "ytdl-core-discord": "github:amishshah/ytdl-core-discord" }, "devDependencies": {}, diff --git a/src/modules/music.js b/src/modules/music.js index 8443e30..3b1d87f 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -37,7 +37,7 @@ exports.getGuild = function (id) { } exports.getLinkFromID = function (id) { - return 'https://www.youtube.com/watch?v=' + id + return 'https://invidio.us/watch?v=' + id } exports.getVideoByQuery = async function (client, query, message) { From 6412ea346d72b6da60c19cf7b0cd3e93be4c93c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:38:00 +0200 Subject: [PATCH 044/110] remove debugs --- src/modules/music.js | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/modules/music.js b/src/modules/music.js index 3b1d87f..d3110cd 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -189,40 +189,23 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { guild.channel = message.channel } - console.log('[MUSIC DEBUG] joining vc'); - const connection = await vc.join() - console.log('[MUSIC DEBUG] joined vc'); - const v = guild.queue[0] - console.log('[MUSIC DEBUG] got v'); - try { - console.log('[MUSIC DEBUG] getting link'); let link = exports.getLinkFromID(v.video.videoId); - console.log('[MUSIC DEBUG] got link: ' + (message.guild.id == '410990517841690625' ? link : 'not woomy server')); let y = null; - - setTimeout(() => { + /*setTimeout(() => { if(y == null) { console.log('[MUSIC DEBUG] y is still null'); }; - }, 5000); - - console.log('[MUSIC DEBUG] await ytdl'); + }, 5000);*/ y = await ytdl(link, { highWaterMark: 1024 * 1024 * 32 }); - console.log('[MUSIC DEBUG] got ytdl'); - console.log('[MUSIC DEBUG] connection.play'); guild.dispatcher = connection.play(y, { type: 'opus' }); - - console.log('[MUSIC DEBUG] got dispatcher'); } catch (err) { - console.error(err); - if (playNext && playNext === true) { guild.queue.splice(1, 1) } else { @@ -233,9 +216,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { 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.') } - console.log('[MUSIC DEBUG] setting volume'); guild.dispatcher.setVolume(0.25) - console.log('[MUSIC DEBUG] set volume'); guild.channel.send('<:player:467216674622537748> Now playing: **' + v.video.title + '** `[' + exports.createTimestamp(v.video.lengthSeconds) + ']`') @@ -245,8 +226,6 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { }); guild.dispatcher.once('finish', () => { - console.log('[MUSIC DEBUG] dispatcher finish'); - guild.queue.shift() guild.playing = false From d92f9ffb8ba90de13c2da2c5ee4f7af0fb496eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 10:49:32 +0200 Subject: [PATCH 045/110] fix --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 413377b..a04e12b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "urban": "^0.3.2", "weather-js": "^2.0.0", "ytdl-core": "github:FLGX06/node-ytdl-core#invidious", - "ytdl-core-discord": "github:amishshah/ytdl-core-discord" + "ytdl-core-discord": "github:FLGX06/ytdl-core-discord#invidious" }, "devDependencies": {}, "scripts": { From d9ac55f8a17d40c4e7b2b408cb44f073a9681241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 11:05:11 +0200 Subject: [PATCH 046/110] print stack of error --- src/modules/music.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/music.js b/src/modules/music.js index d3110cd..fec1e76 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -213,6 +213,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { } client.logger.error('(YT API change, disregard) ' + 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.') } From 95ce384eee1fc67c98c4204fac5745d59f74fdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 11:15:12 +0200 Subject: [PATCH 047/110] add local=true to invidious --- src/modules/music.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index fec1e76..d617ff8 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -37,7 +37,7 @@ exports.getGuild = function (id) { } exports.getLinkFromID = function (id) { - return 'https://invidio.us/watch?v=' + id + return 'https://invidio.us/watch?v=' + id + '&local=true' } exports.getVideoByQuery = async function (client, query, message) { From 5cf74a65ab721eef59073db7ebf78be0ae10dad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 11:24:12 +0200 Subject: [PATCH 048/110] revert --- package.json | 4 ++-- src/modules/music.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a04e12b..e059076 100644 --- a/package.json +++ b/package.json @@ -23,8 +23,8 @@ "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", - "ytdl-core": "github:FLGX06/node-ytdl-core#invidious", - "ytdl-core-discord": "github:FLGX06/ytdl-core-discord#invidious" + "ytdl-core": "^2.1.7", + "ytdl-core-discord": "^1.2.0" }, "devDependencies": {}, "scripts": { diff --git a/src/modules/music.js b/src/modules/music.js index d617ff8..8714af8 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -37,7 +37,7 @@ exports.getGuild = function (id) { } exports.getLinkFromID = function (id) { - return 'https://invidio.us/watch?v=' + id + '&local=true' + return 'https://www.youtube.com/watch?v=' + id } exports.getVideoByQuery = async function (client, query, message) { From f8d9ec1e2f957ba1fd3baea0a29d80cbce1ec0b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20H?= Date: Sat, 6 Jun 2020 11:24:35 +0200 Subject: [PATCH 049/110] remove stack print --- src/modules/music.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/music.js b/src/modules/music.js index 8714af8..ad3a0fc 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -213,7 +213,6 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { } client.logger.error('(YT API change, disregard) ' + 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.') } From ab59d90bda454bad912f7b674275f9c329f38ac4 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 17 Jun 2020 18:12:41 +1000 Subject: [PATCH 050/110] re-enabled neko and nekogif --- src/commands/neko.js | 22 ++++++++++------------ src/commands/nekogif.js | 18 ++++++++---------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/commands/neko.js b/src/commands/neko.js index 6e62f19..6594e6f 100644 --- a/src/commands/neko.js +++ b/src/commands/neko.js @@ -1,21 +1,19 @@ -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)); 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(); }; }; exports.conf = { - enabled: false, + enabled: true, guildOnly: false, aliases: ["catgirl"], permLevel: "User", @@ -25,6 +23,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" }; diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js index cc878e8..5027723 100644 --- a/src/commands/nekogif.js +++ b/src/commands/nekogif.js @@ -1,15 +1,13 @@ -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)); 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(); }; }; From 514d1d15bc0b7e74caaa0b75cc5d5e9794d51727 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 17 Jun 2020 18:13:26 +1000 Subject: [PATCH 051/110] renamed foxgirl kitsune --- src/commands/foxgirl.js | 30 ------------------------------ src/commands/kitsune.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 30 deletions(-) delete mode 100644 src/commands/foxgirl.js create mode 100644 src/commands/kitsune.js diff --git a/src/commands/foxgirl.js b/src/commands/foxgirl.js deleted file mode 100644 index 3d8a0e6..0000000 --- a/src/commands/foxgirl.js +++ /dev/null @@ -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" -}; diff --git a/src/commands/kitsune.js b/src/commands/kitsune.js new file mode 100644 index 0000000..a7f535a --- /dev/null +++ b/src/commands/kitsune.js @@ -0,0 +1,28 @@ +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)); + 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: ['foxgirl'], + permLevel: "User", + requiredPerms: ["EMBED_LINKS"] +}; + +exports.help = { + name: "kitsune", + category: "Image", + description: "Sends you cute wholesome pictures of foxgirls.", + usage: "kitsune" +}; From 0c6e018580f0b956d7493b84b4114fc1ca643c1c Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 17 Jun 2020 18:13:33 +1000 Subject: [PATCH 052/110] added wag --- src/commands/wag.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/commands/wag.js diff --git a/src/commands/wag.js b/src/commands/wag.js new file mode 100644 index 0000000..77e5360 --- /dev/null +++ b/src/commands/wag.js @@ -0,0 +1,28 @@ +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)); + 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" +}; From 92c27be3be153e0192471131e20aafd69aa4e5c1 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Wed, 17 Jun 2020 18:13:41 +1000 Subject: [PATCH 053/110] updated version --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index c095bb6..0cf84d4 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.3", + "number": "1.3.4", "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." } From 101c1581e98fd0033141ea5bae89b457029af25b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hor=C3=A1=C4=8Dek?= Date: Wed, 17 Jun 2020 13:55:28 +0200 Subject: [PATCH 054/110] enable nekogif --- src/commands/nekogif.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js index 5027723..1b729ce 100644 --- a/src/commands/nekogif.js +++ b/src/commands/nekogif.js @@ -13,7 +13,7 @@ exports.run = async (client, message, args) => { }; exports.conf = { - enabled: false, + enabled: true, guildOnly: false, aliases: ["catgirlgif"], permLevel: "User", From 21d4df30b319168e94457680a97439505f7afdfb Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 18 Jun 2020 20:46:42 +1000 Subject: [PATCH 055/110] disabled neko/nekogif --- src/commands/neko.js | 2 +- src/commands/nekogif.js | 2 +- version.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/neko.js b/src/commands/neko.js index 6594e6f..7694a91 100644 --- a/src/commands/neko.js +++ b/src/commands/neko.js @@ -13,7 +13,7 @@ exports.run = async (client, message, args) => { }; exports.conf = { - enabled: true, + enabled: false, guildOnly: false, aliases: ["catgirl"], permLevel: "User", diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js index 1b729ce..ae6c91d 100644 --- a/src/commands/nekogif.js +++ b/src/commands/nekogif.js @@ -13,7 +13,7 @@ exports.run = async (client, message, args) => { }; exports.conf = { - enabled: true, + enabled: false, guildOnly: false, aliases: ["catgirlgif"], permLevel: "User", diff --git a/version.json b/version.json index 0cf84d4..880742a 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.4", + "number": "1.3.5", "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." } From f5a636b52746f0f02ea3219216f72c59637801e7 Mon Sep 17 00:00:00 2001 From: TheCakeChicken Date: Sun, 28 Jun 2020 23:18:16 +0100 Subject: [PATCH 056/110] Disable command --- src/commands/kitsune.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/kitsune.js b/src/commands/kitsune.js index a7f535a..27746fc 100644 --- a/src/commands/kitsune.js +++ b/src/commands/kitsune.js @@ -13,7 +13,7 @@ exports.run = async (client, message, args) => { }; exports.conf = { - enabled: true, + enabled: false, guildOnly: false, aliases: ['foxgirl'], permLevel: "User", From ce10038a955a0a8924bc911b295e159156a26480 Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 30 Jul 2020 19:04:28 +1000 Subject: [PATCH 057/110] update version.json --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 880742a..c001b22 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.5", + "number": "1.3.6", "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." } From 808659246e590adaf33755dbf091d73aee7c545a Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 30 Jul 2020 19:04:54 +1000 Subject: [PATCH 058/110] say command can no longer mention roles --- src/commands/say.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/say.js b/src/commands/say.js index a6c3cca..917e1fc 100644 --- a/src/commands/say.js +++ b/src/commands/say.js @@ -4,7 +4,7 @@ exports.run = (client, message, args, level) => { `<:error:466995152976871434> No message provided. Usage: \`${client.commands.get(`echo`).help.usage}\`` ); }; - if (message.content.includes("@everyone") || message.content.includes("@here")) { + if (message.content.includes("@everyone") || message.content.includes("@here") || message.content.includes("<@&")) { return message.channel.send('>:('); }; From d257d6e730196298bb3ed25846fb187cc11e5f2c Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 30 Jul 2020 19:13:44 +1000 Subject: [PATCH 059/110] fixed "you cant vote twice" bug --- src/commands/fixmusic.js | 6 +++++- src/commands/forceskip.js | 2 ++ src/commands/skip.js | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/commands/fixmusic.js b/src/commands/fixmusic.js index e7c1171..d8ff6c8 100644 --- a/src/commands/fixmusic.js +++ b/src/commands/fixmusic.js @@ -15,6 +15,8 @@ module.exports.run = async (client, message, args, level) =>{ guild.dispatcher.end('silent') } + guild.fixers = [] + message.channel.send( '<:success:466995111885144095> Music has been fixed!' ) @@ -34,7 +36,9 @@ module.exports.run = async (client, message, args, level) =>{ if (guild.dispatcher) { guild.dispatcher.end('silent') - } + } + + guild.fixers = [] message.channel.send( '<:success:466995111885144095> Music has been fixed!' diff --git a/src/commands/forceskip.js b/src/commands/forceskip.js index 0271d8e..0b6c868 100644 --- a/src/commands/forceskip.js +++ b/src/commands/forceskip.js @@ -10,6 +10,8 @@ exports.run = (client, message) => { skip(message.guild, 'skip') + guild.skippers = [] + message.channel.send('<:success:466995111885144095> Song skipped.') }; diff --git a/src/commands/skip.js b/src/commands/skip.js index 35ee02f..c9b83e0 100644 --- a/src/commands/skip.js +++ b/src/commands/skip.js @@ -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.' ) From 0009d569ca2b65ab43014808b432d450a8120c46 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 2 Aug 2020 13:35:09 +1000 Subject: [PATCH 060/110] actually fixed fixmusic --- src/commands/fixmusic.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands/fixmusic.js b/src/commands/fixmusic.js index d8ff6c8..8a2113b 100644 --- a/src/commands/fixmusic.js +++ b/src/commands/fixmusic.js @@ -4,7 +4,7 @@ module.exports.run = async (client, message, args, level) =>{ const lvl = client.config.permLevels.find(l => l.level === level) - if (lvl >= 1) { + if (lvl.level >= 1) { guild.queue = [] guild.playing = false guild.paused = false @@ -24,6 +24,8 @@ module.exports.run = async (client, message, args, level) =>{ return } + 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) From 90e9793377d8cf88aeb588add48b1815bf172c57 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 2 Aug 2020 13:35:17 +1000 Subject: [PATCH 061/110] update to 1.3.7 --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index c001b22..6f202d1 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.6", + "number": "1.3.7", "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." } From 61e69518337836635d9796ba95cf86cba7d0aa22 Mon Sep 17 00:00:00 2001 From: Emily J Date: Wed, 5 Aug 2020 17:08:56 +1000 Subject: [PATCH 062/110] totally didnt steal this fron nyandroid --- src/commands/lmgtfy.js | 31 +++++++++++++++++++++++++++++++ version.json | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/commands/lmgtfy.js diff --git a/src/commands/lmgtfy.js b/src/commands/lmgtfy.js new file mode 100644 index 0000000..ffd031c --- /dev/null +++ b/src/commands/lmgtfy.js @@ -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 " +}; diff --git a/version.json b/version.json index 6f202d1..7a1a175 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.7", + "number": "1.3.8", "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." } From 4bbdac707070308dbb6f01672045bd40c59bccf0 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 16 Aug 2020 18:19:28 +1000 Subject: [PATCH 063/110] Renamed blacklist to blocklist --- src/commands/{blacklist.js => blocklist.js} | 26 ++++++++++----------- src/commands/settings.js | 2 +- src/events/message.js | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) rename src/commands/{blacklist.js => blocklist.js} (76%) diff --git a/src/commands/blacklist.js b/src/commands/blocklist.js similarity index 76% rename from src/commands/blacklist.js rename to src/commands/blocklist.js index 20c41aa..f696217 100644 --- a/src/commands/blacklist.js +++ b/src/commands/blocklist.js @@ -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]" }; diff --git a/src/commands/settings.js b/src/commands/settings.js index eb1f66c..6bdd2b4 100644 --- a/src/commands/settings.js +++ b/src/commands/settings.js @@ -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) }; diff --git a/src/events/message.js b/src/events/message.js index e06bfd2..845e76e 100644 --- a/src/events/message.js +++ b/src/events/message.js @@ -171,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") From 3dcdd1f2ad8a1f64ba26c8e9cb01b8f951d64d0f Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 16 Aug 2020 18:20:26 +1000 Subject: [PATCH 064/110] rate can no longer ping roles --- src/commands/rate.js | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/commands/rate.js b/src/commands/rate.js index 31e05dd..2a23266 100644 --- a/src/commands/rate.js +++ b/src/commands/rate.js @@ -3,23 +3,24 @@ 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")) { - return message.channel.send('>:('); -} + 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}**`); From 18db7e597d2225dc1d534a582bbd6df0743ac7ee Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 16 Aug 2020 18:21:04 +1000 Subject: [PATCH 065/110] update version number --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 7a1a175..aac548b 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.8", + "number": "1.3.9", "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." } From 6d1d4a04411ab4fd53ee70848e2492a968241e5c Mon Sep 17 00:00:00 2001 From: FLGX Date: Sat, 29 Aug 2020 20:58:35 +0200 Subject: [PATCH 066/110] Do not exit on uncaughtException I think I forgot this here while testing something --- src/modules/functions.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/modules/functions.js b/src/modules/functions.js index 6a3a9b7..d76e9fb 100644 --- a/src/modules/functions.js +++ b/src/modules/functions.js @@ -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 => { From ba4781f0f4fee417e9a9c8ba8306f29e1e42792b Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 3 Oct 2020 10:53:00 +1000 Subject: [PATCH 067/110] request intents from gateway --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 49d5326..21f8621 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ const { promisify } = require('util'); const readdir = promisify(require('fs').readdir); const Enmap = require('enmap'); const chalk = require('chalk'); -const client = new Discord.Client(); +const client = new Discord.Client({ ws: { intents: Discord.Intents.ALL }}); try { client.config = require('./config'); From f31f75ae794797009ecfab49d5858b1849e889e9 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 3 Oct 2020 10:53:16 +1000 Subject: [PATCH 068/110] no longer crashes when invalid equation is entered --- src/commands/calculate.js | 82 ++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/src/commands/calculate.js b/src/commands/calculate.js index e7737b3..2ebab0b 100644 --- a/src/commands/calculate.js +++ b/src/commands/calculate.js @@ -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]" -}; \ No newline at end of file + 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]" + }; \ No newline at end of file From 1fba1e9a4ba2201f2f34ef27b748815b05ef817b Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 3 Oct 2020 10:53:38 +1000 Subject: [PATCH 069/110] 1.3.10 --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index aac548b..119b88d 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.9", + "number": "1.3.10", "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." } From ffd056972d75fb11014db6dd326fce6e6fa3c005 Mon Sep 17 00:00:00 2001 From: Emily J Date: Mon, 5 Oct 2020 18:38:22 +1100 Subject: [PATCH 070/110] fix coinflip --- src/commands/coinflip.js | 2 +- version.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/coinflip.js b/src/commands/coinflip.js index 418a996..e051bee 100644 --- a/src/commands/coinflip.js +++ b/src/commands/coinflip.js @@ -7,7 +7,7 @@ exports.run = (client, message, args) => { if(args[0].toLowerCase() != "heads" && args[0].toLowerCase() != "tails") { return message.channel.send( - `<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`flip`).help.usage}\`` + `<:error:466995152976871434> Invalid choice. Usage: \`${client.commands.get(`coinflip`).help.usage}\`` ); }; var coin = [ diff --git a/version.json b/version.json index 119b88d..0fceed0 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.10", - "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.3.11", + "changelog": "**1.3 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." } From 05b35fc207b0b0c59d3e5cb5f8e4837109631060 Mon Sep 17 00:00:00 2001 From: Emily J Date: Mon, 5 Oct 2020 18:42:06 +1100 Subject: [PATCH 071/110] wtf lol --- src/commands/coinflip.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/commands/coinflip.js b/src/commands/coinflip.js index e051bee..4ce5b4a 100644 --- a/src/commands/coinflip.js +++ b/src/commands/coinflip.js @@ -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(`coinflip`).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" }; From 564814a3de17b2281d560121b1fa99ecbc462ee4 Mon Sep 17 00:00:00 2001 From: Emily J Date: Fri, 23 Oct 2020 12:14:23 +1100 Subject: [PATCH 072/110] start requesting only the intents we need --- index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 21f8621..2dc87f5 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,14 @@ const { promisify } = require('util'); const readdir = promisify(require('fs').readdir); const Enmap = require('enmap'); const chalk = require('chalk'); -const client = new Discord.Client({ ws: { intents: Discord.Intents.ALL }}); +const client = new Discord.Client({ ws: { intents: [ + 'GUILDS', + 'GUILD_MEMBERS', + 'GUILD_EMOJIS', + 'GUILD_VOICE_STATES', + 'GUILD_MESSAGES', + 'DIRECT_MESSAGES' +]}}); try { client.config = require('./config'); From 7112c8ff9d5f6e95f5f326792deb38493cab1f20 Mon Sep 17 00:00:00 2001 From: Emily J Date: Fri, 23 Oct 2020 12:14:31 +1100 Subject: [PATCH 073/110] update dependencies --- package.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index e059076..2dea72e 100644 --- a/package.json +++ b/package.json @@ -4,27 +4,27 @@ "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", + "@discordjs/opus": "^0.3.2", + "better-sqlite3": "^7.1.1", "chalk": "^4.0.0", - "dblapi.js": "^2.3.1", - "discord.js": "^12.0.2", - "enmap": "^5.2.4", + "dblapi.js": "^2.4.1", + "discord.js": "^12.4.0", + "enmap": "^5.8.0", "garfield": "^1.1.2", "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", + "node-fetch": "^2.6.1", "prism-media": "^1.2.1", - "randomcolor": "^0.5.4", + "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": "^2.1.7", - "ytdl-core-discord": "^1.2.0" + "ytdl-core": "^3.4.2", + "ytdl-core-discord": "^1.2.3" }, "devDependencies": {}, "scripts": { From a581f07088602eec9b4e77884873271398cc2a16 Mon Sep 17 00:00:00 2001 From: Emily J Date: Fri, 23 Oct 2020 12:14:40 +1100 Subject: [PATCH 074/110] remove fields dependent on presence data --- src/commands/userinfo.js | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/src/commands/userinfo.js b/src/commands/userinfo.js index 98d6738..9a42f4f 100644 --- a/src/commands/userinfo.js +++ b/src/commands/userinfo.js @@ -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); }; From ef0e2d8594fc25108695cb71bf8578001308d6b9 Mon Sep 17 00:00:00 2001 From: Emily J Date: Fri, 23 Oct 2020 12:15:05 +1100 Subject: [PATCH 075/110] update version --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 0fceed0..e226a62 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.11", + "number": "1.3.12", "changelog": "**1.3 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." } From 98255e73aa89bd9cc3a42d0daaa741ee32a7e3ee Mon Sep 17 00:00:00 2001 From: Emily J Date: Fri, 23 Oct 2020 12:34:20 +1100 Subject: [PATCH 076/110] new garfield command --- package.json | 1 - src/commands/garfield.js | 23 +++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 2dea72e..23c9cbf 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "dblapi.js": "^2.4.1", "discord.js": "^12.4.0", "enmap": "^5.8.0", - "garfield": "^1.1.2", "hastebin-gen": "^2.0.5", "moment": "^2.29.1", "moment-duration-format": "^2.3.2", diff --git a/src/commands/garfield.js b/src/commands/garfield.js index 5376ded..597fe16 100644 --- a/src/commands/garfield.js +++ b/src/commands/garfield.js @@ -1,8 +1,23 @@ -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) + }); + message.channel.stopTyping(); + } catch (err) { + message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`) + message.channel.stopTyping(); + }; }; exports.conf = { From 9bf1a81143ea662cd38af46fc2d1d64315bc7890 Mon Sep 17 00:00:00 2001 From: Emily J Date: Fri, 23 Oct 2020 12:34:41 +1100 Subject: [PATCH 077/110] update to 1.3.13 --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index e226a62..4255315 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.12", + "number": "1.3.13", "changelog": "**1.3 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." } From 00196b201d05fd610ec44375a44504218ea4a2e4 Mon Sep 17 00:00:00 2001 From: Emily J Date: Tue, 27 Oct 2020 15:06:27 +1100 Subject: [PATCH 078/110] new api --- src/commands/colour.js | 2 +- version.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/colour.js b/src/commands/colour.js index bdcbf61..776e463 100644 --- a/src/commands/colour.js +++ b/src/commands/colour.js @@ -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) }; diff --git a/version.json b/version.json index 4255315..d11986c 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.13", + "number": "1.3.14", "changelog": "**1.3 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." } From a2f46051e19205aeb579b1c680f2856825e7409a Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 29 Oct 2020 20:16:41 +1100 Subject: [PATCH 079/110] working restart command --- src/commands/restart.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/commands/restart.js b/src/commands/restart.js index f3cf1a7..3731fe6 100644 --- a/src/commands/restart.js +++ b/src/commands/restart.js @@ -1,14 +1,19 @@ -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(); + client.wait(); - 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: { 'signal': 'restart' }, + headers: { 'Authorization': `Bearer ${client.config.server}` } }); - - process.exit(); }; exports.conf = { From 8fc98efe55c145d9a79865fed3693f6559c4fbf9 Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 29 Oct 2020 20:23:34 +1100 Subject: [PATCH 080/110] new restart command x2 --- src/commands/restart.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands/restart.js b/src/commands/restart.js index 3731fe6..fb174fc 100644 --- a/src/commands/restart.js +++ b/src/commands/restart.js @@ -7,12 +7,12 @@ exports.run = (client, message) => {// eslint-disable-line no-unused-vars message.channel.send("<:reboot:467216876938985482> Restarting..."); client.destroy(); - client.wait(); + require("util").promisify(setTimeout); fetch('https://gamecp.apex.to/api/client/servers/1fc76afa-9a4d-497b-983a-a898795ab5b5/power', { method: 'post', - body: { 'signal': 'restart' }, - headers: { 'Authorization': `Bearer ${client.config.server}` } + body: JSON.stringify({ 'signal': 'restart' }), + headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${client.config.server}` } }); }; From 8058f3dced5d15301324e42b4ddcb12a17049042 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 9 Nov 2020 01:39:36 +0000 Subject: [PATCH 081/110] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e37522d..221d3e7 100644 --- a/README.md +++ b/README.md @@ -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. From 0f587bcfffcb957e13f93b48a847a06d8e141d69 Mon Sep 17 00:00:00 2001 From: Lucian Date: Tue, 23 Feb 2021 12:58:40 -0800 Subject: [PATCH 082/110] Add bind to SIGINT --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 2dc87f5..3852abf 100644 --- a/index.js +++ b/index.js @@ -97,4 +97,10 @@ const init = async () => { }; }; -init(); \ No newline at end of file +process.on('SIGINT', function(){ + client.logger.info("Disconnecting...") + client.destroy(); + process.exit(); +}); + +init(); From 42bb347bbf3a027a50f4204ef47d50a1dd3a176e Mon Sep 17 00:00:00 2001 From: Emily J Date: Mon, 1 Mar 2021 11:56:33 +1100 Subject: [PATCH 083/110] update dependencies --- package.json | 14 ++++++-------- src/modules/music.js | 10 +++++----- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 23c9cbf..d8c80bb 100644 --- a/package.json +++ b/package.json @@ -4,26 +4,24 @@ "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.3.2", - "better-sqlite3": "^7.1.1", + "@discordjs/opus": "^0.4.0", + "better-sqlite3": "^7.1.2", "chalk": "^4.0.0", "dblapi.js": "^2.4.1", - "discord.js": "^12.4.0", - "enmap": "^5.8.0", + "discord.js": "^12.5.1", + "enmap": "^5.8.4", + "ffmpeg-static": "^4.2.7", "hastebin-gen": "^2.0.5", "moment": "^2.29.1", "moment-duration-format": "^2.3.2", "nekos.life": "^2.0.5", "node-fetch": "^2.6.1", - "prism-media": "^1.2.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": "^3.4.2", - "ytdl-core-discord": "^1.2.3" + "ytdl-core": "^4.4.5" }, "devDependencies": {}, "scripts": { diff --git a/src/modules/music.js b/src/modules/music.js index ad3a0fc..7100568 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -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') @@ -54,6 +54,8 @@ exports.getVideoByQuery = async function (client, query, message) { return message.channel.send('<:error:466995152976871434> An error has occured: ' + e) }) + console.log(parsed) + if (parsed) { const videos = parsed if (videos) { @@ -194,15 +196,13 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { const v = guild.queue[0] try { - let link = exports.getLinkFromID(v.video.videoId); - let y = null; /*setTimeout(() => { if(y == null) { console.log('[MUSIC DEBUG] y is still null'); }; }, 5000);*/ - y = await ytdl(link, { highWaterMark: 1024 * 1024 * 32 }); + y = await ytdl(exports.getLinkFromID(v.video.videoId) || v.video.videoId, { highWaterMark: 1024 * 1024 * 32 }); guild.dispatcher = connection.play(y, { type: 'opus' }); } catch (err) { @@ -212,7 +212,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { guild.queue.pop() } - client.logger.error('(YT API change, disregard) ' + 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.') } From 45d600ab27ce3d48f5408c41b8a02e6ece7f3390 Mon Sep 17 00:00:00 2001 From: Emily J Date: Mon, 1 Mar 2021 12:58:11 +1100 Subject: [PATCH 084/110] add reactions intent --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3852abf..663f489 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,8 @@ const client = new Discord.Client({ ws: { intents: [ 'GUILD_EMOJIS', 'GUILD_VOICE_STATES', 'GUILD_MESSAGES', - 'DIRECT_MESSAGES' + 'DIRECT_MESSAGES', + 'GUILD_MESSAGE_REACTIONS', ]}}); try { From 9373d9b2de9fb3b54f9ca1e8d7dc1a873afa390c Mon Sep 17 00:00:00 2001 From: Emily J Date: Mon, 1 Mar 2021 12:58:28 +1100 Subject: [PATCH 085/110] THINGS --- package.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d8c80bb..1b1232d 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "better-sqlite3": "^7.1.2", "chalk": "^4.0.0", "dblapi.js": "^2.4.1", + "discord-paginator.js": "github:mudkipscience/discord-paginator.js", "discord.js": "^12.5.1", "enmap": "^5.8.4", "ffmpeg-static": "^4.2.7", @@ -16,14 +17,14 @@ "moment-duration-format": "^2.3.2", "nekos.life": "^2.0.5", "node-fetch": "^2.6.1", + "pretty-ms": "^7.0.1", "randomcolor": "^0.6.2", "relevant-urban": "^2.0.0", "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", - "ytdl-core": "^4.4.5" + "ytdl-core": "^4.5.0" }, - "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, From 58c90ddd9d8f88f165606ac578dabc79319ed5fc Mon Sep 17 00:00:00 2001 From: Emily J Date: Mon, 1 Mar 2021 12:58:39 +1100 Subject: [PATCH 086/110] 1.4 - splatoon commands! --- src/commands/salmonrun.js | 77 ++++++++++++++++++++++++++++++++++++ src/commands/splatnet.js | 53 +++++++++++++++++++++++++ src/commands/splatoonmaps.js | 60 ++++++++++++++++++++++++++++ version.json | 2 +- 4 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 src/commands/salmonrun.js create mode 100644 src/commands/splatnet.js create mode 100644 src/commands/splatoonmaps.js diff --git a/src/commands/salmonrun.js b/src/commands/salmonrun.js new file mode 100644 index 0000000..737b158 --- /dev/null +++ b/src/commands/salmonrun.js @@ -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" + }; diff --git a/src/commands/splatnet.js b/src/commands/splatnet.js new file mode 100644 index 0000000..ae2bea5 --- /dev/null +++ b/src/commands/splatnet.js @@ -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: "Get current and upcoming maps and modes for regular, ranked and league battles.", + usage: "splatoonmaps" + }; diff --git a/src/commands/splatoonmaps.js b/src/commands/splatoonmaps.js new file mode 100644 index 0000000..22941c1 --- /dev/null +++ b/src/commands/splatoonmaps.js @@ -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" + }; diff --git a/version.json b/version.json index d11986c..811fc62 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.14", + "number": "1.4", "changelog": "**1.3 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." } From c59bf6c2451db01e3c7677a032acfde933ee30f0 Mon Sep 17 00:00:00 2001 From: Emily J Date: Mon, 1 Mar 2021 13:05:47 +1100 Subject: [PATCH 087/110] oopsie --- src/commands/splatnet.js | 4 ++-- version.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/splatnet.js b/src/commands/splatnet.js index ae2bea5..50d3c0c 100644 --- a/src/commands/splatnet.js +++ b/src/commands/splatnet.js @@ -48,6 +48,6 @@ exports.conf = { exports.help = { name: "splatnet", category: "Splatoon", - description: "Get current and upcoming maps and modes for regular, ranked and league battles.", - usage: "splatoonmaps" + description: "See what is currently on offer in the splatnet shop.", + usage: "splatnet" }; diff --git a/version.json b/version.json index 811fc62..bcdab76 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { "number": "1.4", - "changelog": "**1.3 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." -} + "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 >.<" +} \ No newline at end of file From fa99b7b1a11cc6e430dde778fc265591f3b99602 Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 18 Mar 2021 12:09:28 +1100 Subject: [PATCH 088/110] missing config values --- configTemplate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configTemplate.js b/configTemplate.js index 2c516a0..d654819 100644 --- a/configTemplate.js +++ b/configTemplate.js @@ -12,6 +12,8 @@ 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: { From 1feb88451cff2eea14a4d4e67ebab40fc440de27 Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 18 Mar 2021 12:10:09 +1100 Subject: [PATCH 089/110] stupid ass bitch bot --- index.js | 5 +++++ package.json | 1 + version.json | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 663f489..13103d4 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,7 @@ 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({ ws: { intents: [ 'GUILDS', @@ -55,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(); diff --git a/package.json b/package.json index 1b1232d..60372e7 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.js", "dependencies": { "@discordjs/opus": "^0.4.0", + "@sentry/node": "^6.2.2", "better-sqlite3": "^7.1.2", "chalk": "^4.0.0", "dblapi.js": "^2.4.1", diff --git a/version.json b/version.json index bcdab76..61fe8a9 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4", + "number": "1.4.1", "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 >.<" } \ No newline at end of file From 479eeeea44113fcc14e3293803b7a3ae558000b7 Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 18 Mar 2021 13:02:59 +1100 Subject: [PATCH 090/110] SHE CNA FUCKIGN SING AGAIN --- package.json | 2 +- src/modules/music.js | 12 +----------- version.json | 2 +- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 60372e7..fee0622 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "discord-paginator.js": "github:mudkipscience/discord-paginator.js", "discord.js": "^12.5.1", "enmap": "^5.8.4", - "ffmpeg-static": "^4.2.7", + "ffmpeg-static": "^4.2.8", "hastebin-gen": "^2.0.5", "moment": "^2.29.1", "moment-duration-format": "^2.3.2", diff --git a/src/modules/music.js b/src/modules/music.js index 7100568..0f5b2ea 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -54,8 +54,6 @@ exports.getVideoByQuery = async function (client, query, message) { return message.channel.send('<:error:466995152976871434> An error has occured: ' + e) }) - console.log(parsed) - if (parsed) { const videos = parsed if (videos) { @@ -196,15 +194,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { const v = guild.queue[0] try { - let y = null; - /*setTimeout(() => { - if(y == null) { - console.log('[MUSIC DEBUG] y is still null'); - }; - }, 5000);*/ - y = await ytdl(exports.getLinkFromID(v.video.videoId) || v.video.videoId, { highWaterMark: 1024 * 1024 * 32 }); - - guild.dispatcher = connection.play(y, { 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) diff --git a/version.json b/version.json index 61fe8a9..b915a4c 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4.1", + "number": "1.4.2", "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 >.<" } \ No newline at end of file From 878cab71e625c096e0375ffee41fdcf7dfa6aa2b Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 18 Mar 2021 13:44:03 +1100 Subject: [PATCH 091/110] clear music msg channel on dispatcher end --- src/commands/fixmusic.js | 2 ++ src/commands/stop.js | 1 + src/modules/music.js | 2 ++ 3 files changed, 5 insertions(+) diff --git a/src/commands/fixmusic.js b/src/commands/fixmusic.js index 8a2113b..fb260db 100644 --- a/src/commands/fixmusic.js +++ b/src/commands/fixmusic.js @@ -10,6 +10,7 @@ module.exports.run = async (client, message, args, level) =>{ guild.paused = false guild.skippers = [] guild.fixers = [] + guild.channel = null if (guild.dispatcher) { guild.dispatcher.end('silent') @@ -35,6 +36,7 @@ module.exports.run = async (client, message, args, level) =>{ guild.paused = false guild.skippers = [] guild.fixers = [] + guild.channel = null if (guild.dispatcher) { guild.dispatcher.end('silent') diff --git a/src/commands/stop.js b/src/commands/stop.js index 4f732ff..4f5a3df 100644 --- a/src/commands/stop.js +++ b/src/commands/stop.js @@ -12,6 +12,7 @@ exports.run = async (client, message) => { guild.paused = false guild.skippers = [] guild.fixers = [] + guild.channel = null message.channel.send('<:success:466995111885144095> Playback stopped!') }; diff --git a/src/modules/music.js b/src/modules/music.js index 0f5b2ea..a61ffbd 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -104,6 +104,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { 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) { guild.queue = [] @@ -227,6 +228,7 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { guild.paused = false guild.skippers = [] guild.fixers = [] + guild.channel = null connection.disconnect() } From 26a39a76fc80aaebe6769e42a915795365d85090 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 3 Apr 2021 15:00:43 +1100 Subject: [PATCH 092/110] stage channels --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index fee0622..ee9cba0 100644 --- a/package.json +++ b/package.json @@ -4,15 +4,15 @@ "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.4.0", - "@sentry/node": "^6.2.2", - "better-sqlite3": "^7.1.2", + "@discordjs/opus": "^0.5.0", + "@sentry/node": "^6.2.5", + "better-sqlite3": "^7.1.4", "chalk": "^4.0.0", "dblapi.js": "^2.4.1", "discord-paginator.js": "github:mudkipscience/discord-paginator.js", - "discord.js": "^12.5.1", + "discord.js": "^12.5.3", "enmap": "^5.8.4", - "ffmpeg-static": "^4.2.8", + "ffmpeg-static": "^4.3.0", "hastebin-gen": "^2.0.5", "moment": "^2.29.1", "moment-duration-format": "^2.3.2", From 5d9bbb44314d88831feaef5fd4f815518fad53ed Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 3 Apr 2021 15:00:56 +1100 Subject: [PATCH 093/110] fix user error resp msg --- src/commands/msearch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/msearch.js b/src/commands/msearch.js index 876da31..914847b 100644 --- a/src/commands/msearch.js +++ b/src/commands/msearch.js @@ -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; From 67c9fdfd3a3f9b285cb2f5a4b3b5f8a2b12faa86 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 3 Apr 2021 15:13:08 +1100 Subject: [PATCH 094/110] bug fixes --- src/commands/ship.js | 8 ++++++-- src/events/messageDelete.js | 2 ++ src/events/messageUpdate.js | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/commands/ship.js b/src/commands/ship.js index cd62b5d..2b21d0d 100644 --- a/src/commands/ship.js +++ b/src/commands/ship.js @@ -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] diff --git a/src/events/messageDelete.js b/src/events/messageDelete.js index c697f3e..97a424a 100644 --- a/src/events/messageDelete.js +++ b/src/events/messageDelete.js @@ -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") { diff --git a/src/events/messageUpdate.js b/src/events/messageUpdate.js index c6aa6e8..bd33ef9 100644 --- a/src/events/messageUpdate.js +++ b/src/events/messageUpdate.js @@ -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})); From 8f271a9a4e5c094366be6584e42895d2ca3fedf7 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sat, 3 Apr 2021 15:14:12 +1100 Subject: [PATCH 095/110] why fix bugs properly when you can ignore them --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index b915a4c..268bd9d 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4.2", + "number": "1.4.3", "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 >.<" } \ No newline at end of file From f09567b239eab6f775202b773ef261729b45d656 Mon Sep 17 00:00:00 2001 From: Emily J Date: Tue, 13 Apr 2021 17:25:16 +1000 Subject: [PATCH 096/110] THANK YOU FOR UNANNOUNCED API CHANGES --- src/commands/nowplaying.js | 2 +- src/commands/songinfo.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/nowplaying.js b/src/commands/nowplaying.js index c26222d..69a5b22 100644 --- a/src/commands/nowplaying.js +++ b/src/commands/nowplaying.js @@ -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('https://invidiou.site' + 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) diff --git a/src/commands/songinfo.js b/src/commands/songinfo.js index cd7bb0b..6d3230c 100644 --- a/src/commands/songinfo.js +++ b/src/commands/songinfo.js @@ -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('https://invidiou.site' + 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) From 2481dacb9152b5c39bf8912ffe08929416e7135d Mon Sep 17 00:00:00 2001 From: Emily J Date: Tue, 13 Apr 2021 17:25:31 +1000 Subject: [PATCH 097/110] WASNT MY FAULT SHIT BROKE BLAME YOUTUBE --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 268bd9d..2a28c9c 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4.3", + "number": "1.4.4", "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 >.<" } \ No newline at end of file From 2564f742d48cc24f3f461a92b1d3c3df26efd056 Mon Sep 17 00:00:00 2001 From: Emily J Date: Wed, 28 Apr 2021 14:50:58 +1000 Subject: [PATCH 098/110] dont silently fail when API fetch fails --- src/commands/catfact.js | 3 +++ src/commands/dogfact.js | 5 ++++- src/commands/garfield.js | 3 +++ src/commands/inspirobot.js | 5 ++++- src/commands/kitsune.js | 5 ++++- src/commands/neko.js | 5 ++++- src/commands/nekogif.js | 5 ++++- src/commands/restart.js | 2 ++ src/commands/rip.js | 3 +++ src/commands/wag.js | 5 ++++- src/commands/yoda.js | 5 ++++- 11 files changed, 39 insertions(+), 7 deletions(-) diff --git a/src/commands/catfact.js b/src/commands/catfact.js index 366999e..c190cd0 100644 --- a/src/commands/catfact.js +++ b/src/commands/catfact.js @@ -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}`); }; diff --git a/src/commands/dogfact.js b/src/commands/dogfact.js index fca8a62..d962a12 100644 --- a/src/commands/dogfact.js +++ b/src/commands/dogfact.js @@ -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}`); }; diff --git a/src/commands/garfield.js b/src/commands/garfield.js index 597fe16..0c262f7 100644 --- a/src/commands/garfield.js +++ b/src/commands/garfield.js @@ -12,6 +12,9 @@ exports.run = async (client, 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) { diff --git a/src/commands/inspirobot.js b/src/commands/inspirobot.js index 17a028f..f7a5865 100644 --- a/src/commands/inspirobot.js +++ b/src/commands/inspirobot.js @@ -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}`) diff --git a/src/commands/kitsune.js b/src/commands/kitsune.js index 27746fc..7abe85f 100644 --- a/src/commands/kitsune.js +++ b/src/commands/kitsune.js @@ -4,7 +4,10 @@ exports.run = async (client, message, args) => { try{ fetch(`https://purrbot.site/api/img/sfw/kitsune/img/`) .then(res => res.json()) - .then(json => message.channel.send(json.link)); + .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}`); diff --git a/src/commands/neko.js b/src/commands/neko.js index 7694a91..0095ba3 100644 --- a/src/commands/neko.js +++ b/src/commands/neko.js @@ -4,7 +4,10 @@ exports.run = async (client, message, args) => { try{ fetch(`https://purrbot.site/api/img/sfw/neko/img/`) .then(res => res.json()) - .then(json => message.channel.send(json.link)); + .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}`); diff --git a/src/commands/nekogif.js b/src/commands/nekogif.js index ae6c91d..122d6de 100644 --- a/src/commands/nekogif.js +++ b/src/commands/nekogif.js @@ -4,7 +4,10 @@ exports.run = async (client, message, args) => { try{ fetch(`https://purrbot.site/api/img/sfw/neko/gif/`) .then(res => res.json()) - .then(json => message.channel.send(json.link)); + .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}`); diff --git a/src/commands/restart.js b/src/commands/restart.js index fb174fc..dfd005a 100644 --- a/src/commands/restart.js +++ b/src/commands/restart.js @@ -13,6 +13,8 @@ exports.run = (client, message) => {// eslint-disable-line no-unused-vars 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}`); }); }; diff --git a/src/commands/rip.js b/src/commands/rip.js index 968e08a..5039140 100644 --- a/src/commands/rip.js +++ b/src/commands/rip.js @@ -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}`); }; diff --git a/src/commands/wag.js b/src/commands/wag.js index 77e5360..a3a5a04 100644 --- a/src/commands/wag.js +++ b/src/commands/wag.js @@ -4,7 +4,10 @@ exports.run = async (client, message, args) => { try{ fetch(`https://purrbot.site/api/img/sfw/tail/gif/`) .then(res => res.json()) - .then(json => message.channel.send(json.link)); + .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}`); diff --git a/src/commands/yoda.js b/src/commands/yoda.js index 496b929..9b71065 100644 --- a/src/commands/yoda.js +++ b/src/commands/yoda.js @@ -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}`); From 05541fe9be518c36ed081569b52ba8a714a12434 Mon Sep 17 00:00:00 2001 From: Emily J Date: Thu, 29 Apr 2021 12:22:30 +1000 Subject: [PATCH 099/110] GO AWYA FLIES AND OTHER GROSS BUGS --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 2a28c9c..d36c406 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4.4", + "number": "1.4.5", "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 >.<" } \ No newline at end of file From f24757fedf40d64656d03fbb554152f15bb6c0f0 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 13 May 2021 09:01:28 +1000 Subject: [PATCH 100/110] update deps --- package.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index ee9cba0..f19e0e5 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,13 @@ "main": "index.js", "dependencies": { "@discordjs/opus": "^0.5.0", - "@sentry/node": "^6.2.5", - "better-sqlite3": "^7.1.4", - "chalk": "^4.0.0", + "@sentry/node": "^6.3.6", + "better-sqlite3": "^7.3.1", + "chalk": "^4.1.1", "dblapi.js": "^2.4.1", "discord-paginator.js": "github:mudkipscience/discord-paginator.js", "discord.js": "^12.5.3", - "enmap": "^5.8.4", + "enmap": "^5.8.5", "ffmpeg-static": "^4.3.0", "hastebin-gen": "^2.0.5", "moment": "^2.29.1", @@ -24,7 +24,7 @@ "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", - "ytdl-core": "^4.5.0" + "ytdl-core": "^4.7.0" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" From 22ac7bee2ea95827344556bc5a27b093a6a234f8 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Thu, 13 May 2021 09:12:42 +1000 Subject: [PATCH 101/110] include link to message in messageUpdate logs --- src/events/messageUpdate.js | 2 +- version.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/events/messageUpdate.js b/src/events/messageUpdate.js index bd33ef9..c7623e1 100644 --- a/src/events/messageUpdate.js +++ b/src/events/messageUpdate.js @@ -30,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) { diff --git a/version.json b/version.json index d36c406..10a1e59 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4.5", + "number": "1.4.6", "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 >.<" } \ No newline at end of file From 82bfed57aaf61f9a272f09ddd8964a7b0eeea014 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Fri, 28 May 2021 22:26:53 +1000 Subject: [PATCH 102/110] YOUTHUBE FUCKING DSOTP CHANGING MSHIT FUCKER --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f19e0e5..7b3c4b7 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "main": "index.js", "dependencies": { "@discordjs/opus": "^0.5.0", - "@sentry/node": "^6.3.6", - "better-sqlite3": "^7.3.1", + "@sentry/node": "^6.4.1", + "better-sqlite3": "^7.4.0", "chalk": "^4.1.1", "dblapi.js": "^2.4.1", "discord-paginator.js": "github:mudkipscience/discord-paginator.js", @@ -24,7 +24,7 @@ "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", - "ytdl-core": "^4.7.0" + "ytdl-core": "^4.8.2" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" From 684d49ae5b1acc95a8d21ce5ed58515624d1d156 Mon Sep 17 00:00:00 2001 From: Emily Wood Date: Fri, 17 Sep 2021 12:38:15 +1000 Subject: [PATCH 103/110] module updates --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 7b3c4b7..55a183a 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "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.5.0", - "@sentry/node": "^6.4.1", + "@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": "github:mudkipscience/discord-paginator.js", + "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", @@ -24,7 +24,7 @@ "to-zalgo": "^1.0.1", "urban": "^0.3.2", "weather-js": "^2.0.0", - "ytdl-core": "^4.8.2" + "ytdl-core": "^4.9.1" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" From 5289977fb5113fe231280596fa887a30303c9515 Mon Sep 17 00:00:00 2001 From: Emily Wood Date: Fri, 17 Sep 2021 12:38:25 +1000 Subject: [PATCH 104/110] fix incorrect help info --- src/commands/play.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/play.js b/src/commands/play.js index 882aedd..a876c63 100644 --- a/src/commands/play.js +++ b/src/commands/play.js @@ -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]', }; From 3e80f2c5a24bc6cd9ee193e6ba7e1f1309e11a4d Mon Sep 17 00:00:00 2001 From: Emily Wood Date: Fri, 17 Sep 2021 12:38:34 +1000 Subject: [PATCH 105/110] updated to 1.4.7 --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 10a1e59..46362b1 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4.6", + "number": "1.4.7", "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 >.<" } \ No newline at end of file From 55c546aa6a8ba8868c942bf92bc2b795d4591a89 Mon Sep 17 00:00:00 2001 From: Emily Wood Date: Fri, 15 Oct 2021 22:28:24 +1100 Subject: [PATCH 106/110] remove hardcoded invidious instances --- src/commands/nowplaying.js | 2 +- src/commands/songinfo.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/commands/nowplaying.js b/src/commands/nowplaying.js index 69a5b22..288e51a 100644 --- a/src/commands/nowplaying.js +++ b/src/commands/nowplaying.js @@ -17,7 +17,7 @@ exports.run = async (client, message) => { const embed = new MessageEmbed() embed.setTitle('Now playing') - embed.setThumbnail('https://invidiou.site' + 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) diff --git a/src/commands/songinfo.js b/src/commands/songinfo.js index 6d3230c..ac74bbb 100644 --- a/src/commands/songinfo.js +++ b/src/commands/songinfo.js @@ -20,7 +20,7 @@ exports.run = async (client, message, args) => { } const embed = new MessageEmbed() - embed.setThumbnail('https://invidiou.site' + 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) From ddb81ed114befd0cd376beb9049ebef7634b545c Mon Sep 17 00:00:00 2001 From: Emily Wood Date: Fri, 15 Oct 2021 22:29:12 +1100 Subject: [PATCH 107/110] minor changes to invidious endpoint format --- configTemplate.js | 2 +- src/modules/music.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configTemplate.js b/configTemplate.js index d654819..7480756 100644 --- a/configTemplate.js +++ b/configTemplate.js @@ -17,7 +17,7 @@ const config = { // Configurable API endpoints endpoints: { - invidious: 'https://invidio.us/api/' + invidious: '' }, // Default per-server settings diff --git a/src/modules/music.js b/src/modules/music.js index a61ffbd..edf4c65 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -45,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) { From 90a0aea5bf49cf20b32d47980372795654cdacea Mon Sep 17 00:00:00 2001 From: Emily Wood Date: Fri, 15 Oct 2021 22:29:21 +1100 Subject: [PATCH 108/110] 1.4.8 (music stuff) --- version.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.json b/version.json index 46362b1..8b6da90 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.4.7", + "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 >.<" } \ No newline at end of file From bc18ea8abdc15f372c4c5c51767433a4276864b2 Mon Sep 17 00:00:00 2001 From: f3d0r4 Date: Thu, 25 Nov 2021 19:36:15 +0000 Subject: [PATCH 109/110] Update 'resources/other/lyrics.json' Fixed typos of capitalization in lyrics as this would cause the command to unexpectedly fail --- resources/other/lyrics.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/other/lyrics.json b/resources/other/lyrics.json index cd753d2..088dc72 100644 --- a/resources/other/lyrics.json +++ b/resources/other/lyrics.json @@ -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": [ From eb9c98612a82a7e9d3401a39bc2fd5a8f7283265 Mon Sep 17 00:00:00 2001 From: ItzRock Date: Sat, 19 Feb 2022 22:18:39 +0000 Subject: [PATCH 110/110] Fixing issue where woomy would endlessly type from an api error --- src/commands/weather.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/weather.js b/src/commands/weather.js index ef01bc8..880436c 100644 --- a/src/commands/weather.js +++ b/src/commands/weather.js @@ -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}\``) }; };