silvanus/dot-commands/message.js

23 lines
727 B
JavaScript
Raw Normal View History

2023-05-16 18:06:51 +00:00
const fn = require('../modules/functions.js');
module.exports = {
name: "message",
description: "Send a message to a server owner or server",
2023-06-05 21:24:05 +00:00
usage: "<serverID> <content>".message,
2023-06-03 19:40:12 +00:00
permission: "owner",
2023-05-16 18:06:51 +00:00
async execute(message, commandData) {
2023-06-03 19:40:12 +00:00
if (fn.dotCommands.checkPermissions(this.permission, message.author.id)) {
try {
// Code Here
args = commandData.args.split(" ");
2023-06-05 21:24:05 +00:00
const guildOwnerId = args.shift();
const content = args.join(" ");
const dmChannel = await message.client.users.createDM(guildOwnerId);
await dmChannel.send(content);
2023-06-03 19:40:12 +00:00
} catch (err) {
console.error(err);
2023-06-05 21:24:05 +00:00
await message.reply(fn.builders.errorEmbed("There was an error running the command: " + err));
2023-06-03 19:40:12 +00:00
}
2023-05-16 18:06:51 +00:00
}
}
}