From 1c21161500f2b733e6ee2555385ec2bf43fa4096 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 10 Mar 2020 09:37:48 +1100 Subject: [PATCH 1/4] Bots have a bot badge, avatars are larger --- changes.txt | 2 ++ src/commands/about.js | 2 +- src/commands/avatar.js | 2 +- src/commands/ban.js | 2 +- src/commands/giverole.js | 2 +- src/commands/hackban.js | 2 +- src/commands/kick.js | 2 +- src/commands/nowplaying.js | 2 +- src/commands/purge.js | 2 +- src/commands/servericon.js | 2 +- src/commands/serverinfo.js | 2 +- src/commands/softban.js | 2 +- src/commands/takerole.js | 2 +- src/commands/userinfo.js | 14 +++++++++++--- 14 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 changes.txt diff --git a/changes.txt b/changes.txt new file mode 100644 index 0000000..daa5b88 --- /dev/null +++ b/changes.txt @@ -0,0 +1,2 @@ +Links to avatars now lead to the original file size +Bots now get a bot badge in the userinfo command diff --git a/src/commands/about.js b/src/commands/about.js index 02b2c2c..5c1538f 100644 --- a/src/commands/about.js +++ b/src/commands/about.js @@ -28,7 +28,7 @@ exports.run = (client, message) => { embed = new Discord.MessageEmbed(); embed.setTitle(`Woomy`); embed.setColor(client.embedColour(message)); - embed.setThumbnail(client.user.avatarURL({format: "png", dynamic: true})) + embed.setThumbnail(client.user.avatarURL({format: "png", dynamic: true, size: 2048})) embed.addField( "General:", `• users: \`${client.users.cache.size}\`\n• channels: \`${client.channels.cache.size}\`\n• servers: \`${client.guilds.cache.size}\`\n• commands: \`${client.commands.size}\`\n• uptime: \`${duration}\``,true ); diff --git a/src/commands/avatar.js b/src/commands/avatar.js index 1bbb9e4..5832be2 100644 --- a/src/commands/avatar.js +++ b/src/commands/avatar.js @@ -19,7 +19,7 @@ exports.run = (client, message, args) => { user = users[0]; user = user.user; } - message.channel.send(`**${user.tag}'s** avatar is: ${user.avatarURL({format: "png", dynamic: true})}`); + message.channel.send(`**${user.tag}'s** avatar is: ${user.avatarURL({format: "png", dynamic: true, size: 2048})}`); }; exports.conf = { diff --git a/src/commands/ban.js b/src/commands/ban.js index fe403c2..affa882 100644 --- a/src/commands/ban.js +++ b/src/commands/ban.js @@ -58,7 +58,7 @@ exports.run = async (client, message, args) => { if (channel) { let embed = new Discord.MessageEmbed(); embed.setColor("#BC0057"); - embed.setAuthor("User banned!", user.user.avatarURL({format: "png", dynamic: true})); + embed.setAuthor("User banned!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); embed.setDescription( `• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}` ); diff --git a/src/commands/giverole.js b/src/commands/giverole.js index 356cd74..f62a055 100644 --- a/src/commands/giverole.js +++ b/src/commands/giverole.js @@ -59,7 +59,7 @@ exports.run = async (client, message, [member, ...role2add], query) => { if (channel) { let embed = new Discord.MessageEmbed(); embed.setColor("#00c09a"); - embed.setAuthor("Role given:", user.user.avatarURL({format: "png", dynamic: true})); + embed.setAuthor("Role given:", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); embed.setDescription(`‏‏‎• User: ${user} (${user.user.id})\n‏‏‎• Mod: ${message.author} (${message.author.id})\n‏‏‎• Role: ${gRole}`) try { channel.send({ embed }); diff --git a/src/commands/hackban.js b/src/commands/hackban.js index c18b880..ff4d1cb 100644 --- a/src/commands/hackban.js +++ b/src/commands/hackban.js @@ -31,7 +31,7 @@ exports.run = async (client, message, args) => { if (channel) { let embed = new Discord.MessageEmbed(); embed.setColor("#BC0057"); - embed.setAuthor("User banned!", user.avatarURL({format: "png", dynamic: true})); + embed.setAuthor("User banned!", user.avatarURL({format: "png", dynamic: true, size: 2048})); embed.setDescription( `• User: ${user.tag} (${user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}` ); diff --git a/src/commands/kick.js b/src/commands/kick.js index 0002f44..9070a98 100644 --- a/src/commands/kick.js +++ b/src/commands/kick.js @@ -58,7 +58,7 @@ if (settings.modlogsChannel !== "off") { if (channel) { let embed = new Discord.MessageEmbed(); embed.setColor("#fd0061"); - embed.setAuthor("User kicked!", user.user.avatarURL({format: "png", dynamic: true})); + embed.setAuthor("User kicked!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); embed.setDescription( `• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Reason: ${reason}` ); diff --git a/src/commands/nowplaying.js b/src/commands/nowplaying.js index 9aa0487..e94f71a 100644 --- a/src/commands/nowplaying.js +++ b/src/commands/nowplaying.js @@ -23,7 +23,7 @@ exports.run = async (client, 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})) + embed.setFooter("Requested by " + song.requestedBy.tag, song.requestedBy.avatarURL({format: "png", dynamic: true, size: 2048})) message.channel.send(embed) }; diff --git a/src/commands/purge.js b/src/commands/purge.js index 406bf64..79cf320 100644 --- a/src/commands/purge.js +++ b/src/commands/purge.js @@ -34,7 +34,7 @@ exports.run = async (client, message, args, level) => { if (channel) { let embed = new Discord.MessageEmbed(); embed.setColor("#a62019"); - embed.setAuthor(`${amount} messages purged!`, message.author.avatarURL({format: "png", dynamic: true})); + embed.setAuthor(`${amount} messages purged!`, message.author.avatarURL({format: "png", dynamic: true, size: 2048})); embed.setDescription(`• Channel: ${message.channel.name} (${message.channel.id})\n• Mod: ${message.author} (${message.author.id})\n• Amount: \`${amount}\``) try { channel.send({ embed }); diff --git a/src/commands/servericon.js b/src/commands/servericon.js index 5a22748..2eb44c4 100644 --- a/src/commands/servericon.js +++ b/src/commands/servericon.js @@ -1,5 +1,5 @@ exports.run = (client, message) => { - message.channel.send(`**${message.guild}'s** icon is:\n${message.guild.iconURL({format: "png", dynamic: true})}`) + message.channel.send(`**${message.guild}'s** icon is:\n${message.guild.iconURL({format: "png", dynamic: true, size: 2048})}`) }; exports.conf = { diff --git a/src/commands/serverinfo.js b/src/commands/serverinfo.js index 41c8b0c..89c2230 100644 --- a/src/commands/serverinfo.js +++ b/src/commands/serverinfo.js @@ -78,7 +78,7 @@ exports.run = (client, message) => { .setColor(message.guild.member(client.user).displayHexColor) .setTitle(guild.name) .setDescription(`${badges}• **ID:** ${guild.id}\n• **Owner:** ${guild.owner}\n• **Region:** ${guild.region.toProperCase()}\n• **Boosts:** ${boosts}\n• **Members:** ${members}\n• **Channels:** ${channelString}\n• **Roles:** ${roles}\n• **Emojis:** ${emojiString}\n• **Creation date:** ${guild.createdAt}`) - .setThumbnail(message.guild.iconURL({format: "png", dynamic: true})); + .setThumbnail(message.guild.iconURL({format: "png", dynamic: true, size: 2048})); message.channel.send(embed); }; diff --git a/src/commands/softban.js b/src/commands/softban.js index ca95e60..1b602c5 100644 --- a/src/commands/softban.js +++ b/src/commands/softban.js @@ -71,7 +71,7 @@ exports.run = async (client, message, args) => { if (channel) { let embed = new Discord.MessageEmbed(); embed.setColor("#F38159"); - embed.setAuthor("User softbanned!", user.user.avatarURL({format: "png", dynamic: true})); + embed.setAuthor("User softbanned!", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); embed.setDescription( `• User: ${user.user.tag} (${user.user.id})\n• Mod: ${message.author} (${message.author.id})\n• Days cleared: ${days}` ); diff --git a/src/commands/takerole.js b/src/commands/takerole.js index 4a11fa6..408d0e3 100644 --- a/src/commands/takerole.js +++ b/src/commands/takerole.js @@ -59,7 +59,7 @@ exports.run = async (client, message, [member, ...role2add], query) => { if (channel) { let embed = new Discord.MessageEmbed(); embed.setColor("#008369"); - embed.setAuthor("Role taken:", user.user.avatarURL({format: "png", dynamic: true})); + embed.setAuthor("Role taken:", user.user.avatarURL({format: "png", dynamic: true, size: 2048})); embed.setDescription(`‏‏‎• User: ${user} (${user.user.id})\n‏‏‎• Mod: ${message.author} (${message.author.id})\n‏‏‎• Role: ${gRole}`) try { channel.send({ embed }); diff --git a/src/commands/userinfo.js b/src/commands/userinfo.js index 1ad7ec0..f84b40a 100644 --- a/src/commands/userinfo.js +++ b/src/commands/userinfo.js @@ -40,7 +40,15 @@ exports.run = (client, message, args) => { }; if(user.user.id == message.guild.ownerID) { - badges = "<:owner:685703193694306331>\n" + badges += "<:owner:685703193694306331>" + } + + if(user.user.bot) { + badges += "<:bot:686489601678114859>" + } + + if(badges.length > 0) { + badges += "\n" } createdTimestamp = user.user.createdTimestamp; @@ -61,13 +69,13 @@ exports.run = (client, message, args) => { id = user.user.id; tag = user.user.tag; colour = user.displayHexColor; - avurl = user.user.avatarURL({format: "png", dynamic: true}); + avurl = user.user.avatarURL({format: "png", dynamic: true, size: 2048}); createdAt = user.user.createdAt; } else { id = user.id; tag = user.tag; colour = ["#ff9d68", "#ff97cb", "#d789ff", "#74FFFF"].random(); - avurl = user.avatarURL({format: "png", dynamic: true}); + avurl = user.avatarURL({format: "png", dynamic: true, size: 2048}); createdAt = user.createdAt; }; From 3af8fdb2b090912564aceae480c00de93621e8aa Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 10 Mar 2020 10:11:53 +1100 Subject: [PATCH 2/4] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 693f553..d0fde98 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # 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. +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. -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. +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 # Requirements - git - node.js v12.0.0 or higher - node-gyp build tools -- ffmpeg +- ffmpeg (or ffmpeg-static) # Installation - Clone Woomy to your machine @@ -18,4 +18,4 @@ Self hosting is generally not recommended, but instructions are provided below i - Open config.js in your code editor and insert all the required information # Contributing -If you wish to contribute to Woomy, please fork the repository and open a pull request. +If you wish to contribute to Woomy, please fork the repository and open a pull request. Any contribution is appreciated <3 From 85be37097d0da55656d746e0e6ee2271edf7a7b6 Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 10 Mar 2020 10:17:32 +1100 Subject: [PATCH 3/4] Update configTemplate.js --- configTemplate.js | 129 +++++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 64 deletions(-) diff --git a/configTemplate.js b/configTemplate.js index a8adf42..3828ed8 100644 --- a/configTemplate.js +++ b/configTemplate.js @@ -1,68 +1,69 @@ const config = { - // ID's - "owners": ["433790467830972417", "324937993972350976"], - - // Tokens - "token": "", - "devtoken": "", - "ytkey": "", - "dblkey": "", - - // Default per-server settings - "defaultSettings" : { - "prefix": "~", - "devprefix": "!", - "modRole": "None set", - "adminRole": "None set", - "mutedRole": "None set", - "autorole": "off", - "welcomeChannel": "off", - "welcomeMessage": "off", - "leaveMessage": "off", - "chatlogsChannel": "off", - "modlogsChannel": "off", - "raidMode": "off", - "raidModeStrict": "off", - "blacklisted": "ARRAY", - "botChannels": "ARRAY", - "AFK": "ARRAY", - "SAR": "ARRAY" + // ID's + "owners": [], // Adding your ID here will give you access to dangerous commands like eval. Please be careful with who you add here! Eval can be used to modify the host machine. + + // 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. + + // Default per-server settings + "defaultSettings" : { + "prefix": "~", + "devprefix": "!", + "modRole": "None set", + "adminRole": "None set", + "mutedRole": "None set", + "autorole": "off", + "welcomeChannel": "off", + "welcomeMessage": "off", + "leaveMessage": "off", + "chatlogsChannel": "off", + "modlogsChannel": "off", + "raidMode": "off", + "raidModeStrict": "off", + "blacklisted": "ARRAY", + "botChannels": "ARRAY", + "AFK": "ARRAY", + "SAR": "ARRAY", + "customCommands": "ARRAY", + }, + + // Perm levels + permLevels: [ + { level: 0, + name: "User", + check: () => true }, - - // Perm levels - permLevels: [ - { level: 0, - name: "User", - check: () => true - }, - - { level: 1, - name: "Moderator", - check: (message) => { - try { - if (message.member.roles.has(message.settings.modRole)) return true; - } catch (e) { - return false; - } + + { level: 1, + name: "Moderator", + check: (message) => { + try { + if (message.member.roles.cache.has(message.settings.modRole)) return true; + } catch (e) { + return false; } - }, - - { level: 2, - name: "Administrator", - check: (message) => { - try { - if (message.member.roles.has(message.settings.adminRole)) return true; - } catch (e) { - return false; - } + } + }, + + { level: 2, + name: "Administrator", + check: (message) => { + try { + if (message.member.roles.cache.has(message.settings.adminRole) || message.member.permissions.has("ADMINISTRATOR")) return true; + } catch (e) { + return false; } - }, - - { level: 3, - name: "Server Owner", - check: (message) => message.channel.type === "text" ? (message.guild.ownerID === message.author.id ? true : false) : false - }, - ] - }; - - module.exports = config; \ No newline at end of file + } + }, + + { level: 3, + name: "Server Owner", + check: (message) => message.channel.type === "text" ? (message.guild.ownerID === message.author.id ? true : false) : false + }, + ] +}; + +module.exports = config; From 1bf10ccc0c859df819e7571cb8e0d5cc20d872ab Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Tue, 10 Mar 2020 10:57:54 +1100 Subject: [PATCH 4/4] Fixed catfact --- src/commands/catfact.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/catfact.js b/src/commands/catfact.js index 7505a1b..97063fc 100644 --- a/src/commands/catfact.js +++ b/src/commands/catfact.js @@ -3,7 +3,7 @@ const request = require("request"); exports.run = async (bot, message, args) => { request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => { if (error) throw new Error(error); - message.channel.send(`**Did you know?**\n ${body.facts[0]}`); + message.channel.send(`**Did you know?**\n ${body.data[0].fact}`); }); };