Preliminary DM support, update URLs to point to new repo link
This commit is contained in:
parent
631cdc5ef6
commit
c471bd8af8
27 changed files with 105 additions and 66 deletions
|
@ -5,7 +5,7 @@ exports.run = async (message, args) => {
|
|||
return message.mentions[0].dynamicAvatarURL(null, 1024);
|
||||
} else if (client.users.get(args[0]) !== undefined) {
|
||||
return client.users.get(args[0]).dynamicAvatarURL(null, 1024);
|
||||
} else if (args.join(" ") !== "") {
|
||||
} else if (args.join(" ") !== "" && message.channel.guild) {
|
||||
const userRegex = new RegExp(args.join("|"), "i");
|
||||
const member = message.channel.guild.members.find(element => {
|
||||
return userRegex.test(element.nick) ? userRegex.test(element.nick) : userRegex.test(element.username);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const client = require("../utils/client.js");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
if (!message.member.permission.has("banMembers")) return `${message.author.mention}, you need to have the \`Ban Members\` permission on this server to ban people!`;
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("banMembers") && !message.channel.permissionsOf(client.user.id).has("banMembers")) return `${message.author.mention}, I don't have the \`Ban Members\` permission!`;
|
||||
const member = message.mentions[0];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const db = require("../utils/database.js");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
if (!message.member.permission.has("administrator") && message.member.id !== process.env.OWNER) return `${message.author.mention}, you need to be an administrator to enable/disable me!`;
|
||||
if (args.length === 0) return `${message.author.mention}, you need to provide whether I should be enabled or disabled in this channel!`;
|
||||
if (args[0] !== "disable" && args[0] !== "enable") return `${message.author.mention}, that's not a valid option!`;
|
||||
|
|
|
@ -3,8 +3,8 @@ const paginator = require("../utils/pagination/pagination.js");
|
|||
const database = require("../utils/database.js");
|
||||
|
||||
exports.run = async (message) => {
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`;
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`;
|
||||
if (message.channel.guild && !message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`;
|
||||
if (message.channel.guild && !message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`;
|
||||
const counts = (await database.global.findOne({})).cmdCounts;
|
||||
const countArray = [];
|
||||
const sortedValues = [...counts.entries()].sort((a, b) => {
|
||||
|
|
|
@ -21,7 +21,7 @@ exports.run = async (message, args) => {
|
|||
value: `${message.author.username}#${message.author.discriminator}`
|
||||
}, {
|
||||
name: "👪 Server:",
|
||||
value: message.channel.guild.name
|
||||
value: message.channel.guild ? message.channel.guild.name : "N/A"
|
||||
}, {
|
||||
name: "💬 Message:",
|
||||
value: args.join(" ")
|
||||
|
|
|
@ -6,7 +6,7 @@ const paginator = require("../utils/pagination/pagination.js");
|
|||
const tips = ["You can change the bot's prefix using the prefix command.", "Image commands also work with images previously posted in that channel.", "You can use the tags commands to save things for later use.", "You can visit https://projectlounge.pw/esmBot/help.html for a web version of this command list.", "You can view a command's aliases by putting the command name after the help command (e.g. help image).", "Parameters wrapped in [] are required, while parameters wrapped in {} are optional.", "esmBot is hosted and paid for completely out-of-pocket by the main developer. If you want to support development, please consider donating! https://patreon.com/TheEssem"];
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
const guild = await database.guilds.findOne({ id: message.channel.guild.id });
|
||||
const { prefix } = message.channel.guild ? await database.guilds.findOne({ id: message.channel.guild.id }) : "N/A";
|
||||
const commands = collections.commands;
|
||||
const aliases = collections.aliases;
|
||||
if (args.length !== 0 && (commands.has(args[0].toLowerCase()) || aliases.has(args[0].toLowerCase()))) {
|
||||
|
@ -19,7 +19,7 @@ exports.run = async (message, args) => {
|
|||
"name": "esmBot Help",
|
||||
"icon_url": client.user.avatarURL
|
||||
},
|
||||
"title": `${guild.prefix}${command}`,
|
||||
"title": `${prefix}${command}`,
|
||||
"url": "https://projectlounge.pw/esmBot/help.html",
|
||||
"description": info.description,
|
||||
"color": 16711680,
|
||||
|
@ -101,7 +101,7 @@ exports.run = async (message, args) => {
|
|||
},
|
||||
"fields": [{
|
||||
"name": "Prefix",
|
||||
"value": guild.prefix
|
||||
"value": prefix
|
||||
}, {
|
||||
"name": "Tip",
|
||||
"value": misc.random(tips)
|
||||
|
|
|
@ -3,8 +3,8 @@ const paginator = require("../utils/pagination/pagination.js");
|
|||
const { image_search } = require("duckduckgo-images-api");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`;
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`;
|
||||
if (message.channel.guild && !message.channel.guild.members.get(client.user.id).permission.has("addReactions") && !message.channel.permissionsOf(client.user.id).has("addReactions")) return `${message.author.mention}, I don't have the \`Add Reactions\` permission!`;
|
||||
if (message.channel.guild && !message.channel.guild.members.get(client.user.id).permission.has("embedLinks") && !message.channel.permissionsOf(client.user.id).has("embedLinks")) return `${message.author.mention}, I don't have the \`Embed Links\` permission!`;
|
||||
if (args.length === 0) return `${message.author.mention}, you need to provide something to search for!`;
|
||||
const embeds = [];
|
||||
const images = await image_search({ query: args.join(" "), moderate: true });
|
||||
|
|
|
@ -34,7 +34,7 @@ exports.run = async () => {
|
|||
},
|
||||
{
|
||||
"name": "💻 Source Code:",
|
||||
"value": "[Click here!](https://github.com/TheEssem/esmBot)"
|
||||
"value": "[Click here!](https://github.com/esmBot/esmBot)"
|
||||
},
|
||||
{
|
||||
"name": "<:twitter:652550515372064768> Twitter:",
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const client = require("../utils/client.js");
|
||||
|
||||
exports.run = async (message) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
if (!message.member.permission.has("kickMembers")) return `${message.author.mention}, you need to have the \`Kick Members\` permission on this server to kick people!`;
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("kickMembers") && !message.channel.permissionsOf(client.user.id).has("kickMembers")) return `${message.author.mention}, I don't have the \`Kick Members\` permission!`;
|
||||
const member = message.mentions[0];
|
||||
|
|
|
@ -2,7 +2,7 @@ const client = require("../utils/client.js");
|
|||
|
||||
exports.run = async (message) => {
|
||||
const pingMessage = await client.createMessage(message.channel.id, "🏓 Ping?");
|
||||
return pingMessage.edit(`🏓 Pong!\n\`\`\`\nLatency: ${pingMessage.timestamp - message.timestamp}ms\nAPI Latency: ${Math.round(client.shards.get(client.guildShardMap[message.channel.guild.id]).latency)}ms\n\`\`\``);
|
||||
return pingMessage.edit(`🏓 Pong!\n\`\`\`\nLatency: ${pingMessage.timestamp - message.timestamp}ms${message.channel.guild ? `\nShard Latency: ${Math.round(client.shards.get(client.guildShardMap[message.channel.guild.id]).latency)}ms` : ""}\n\`\`\``);
|
||||
};
|
||||
|
||||
exports.aliases = ["pong"];
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const database = require("../utils/database.js");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
const guild = await database.guilds.findOne({ id: message.channel.guild.id });
|
||||
if (args.length !== 0) {
|
||||
if (!message.member.permission.has("administrator") && message.member.id !== process.env.OWNER) return `${message.author.mention}, you need to be an administrator to change the bot prefix!`;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
const client = require("../utils/client.js");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
if (!message.member.permission.has("manageMessages")) return `${message.author.mention}, you need to have the \`Manage Messages\` permission on this server to purge messages!`;
|
||||
if (!message.channel.guild.members.get(client.user.id).permission.has("manageMessages") && !message.channel.permissionsOf(client.user.id).has("manageMessages")) return `${message.author.mention}, I don't have the \`Manage Messages\` permission!`;
|
||||
if (args.length === 0 || !args[0].match(/^\d+$/)) return `${message.author.mention}, you need to provide the number of messages to purge!`;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
exports.run = async (message) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
const owner = await message.channel.guild.members.get(message.channel.guild.ownerID);
|
||||
const infoEmbed = {
|
||||
"embed": {
|
||||
|
|
|
@ -4,6 +4,7 @@ const paginator = require("../utils/pagination/pagination.js");
|
|||
const { random } = require("../utils/misc.js");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
if (args.length === 0) return `${message.author.mention}, you need to specify the name of the tag you want to view!`;
|
||||
const guild = await database.guilds.findOne({ id: message.channel.guild.id });
|
||||
const tags = guild.tags;
|
||||
|
|
|
@ -15,7 +15,7 @@ exports.run = async (message, args) => {
|
|||
user = message.author;
|
||||
}
|
||||
//const user = getUser !== undefined ? getUser : (message.author);
|
||||
const member = message.channel.guild.members.get(user.id);
|
||||
const member = message.channel.guild ? message.channel.guild.members.get(user.id) : undefined;
|
||||
const infoEmbed = {
|
||||
"embed": {
|
||||
"title": `${user.username}#${user.discriminator}`,
|
||||
|
|
|
@ -3,6 +3,7 @@ const client = require("../utils/client.js");
|
|||
const paginator = require("../utils/pagination/pagination.js");
|
||||
|
||||
exports.run = async (message, args) => {
|
||||
if (!message.channel.guild) return `${message.author.mention}, this command only works in servers!`;
|
||||
if (!message.member.permission.has("manageMessages")) return `${message.author.mention}, you need to have the \`Manage Messages\` permission on this server to warn people!`;
|
||||
const memberCheck = message.mentions.length >= 1 ? message.mentions[0] : client.users.get(args[0]);
|
||||
const member = memberCheck ? memberCheck : client.users.get(args[0].replace(/\D/g, ""));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue