const { RichEmbed, MessageEmbedImage } = require("discord.js");
const { promptMessage } = require("../../functions.js");
module.exports = {
name: "bugreport",
aliases: ["bugreports"],
usage: "bugreport <your report>",
description: "Send your report",
category: "server",
run: async (client, message, args) => {
const channel = message.guild.channels.find(c => c.name === "「❗」reports");
if (message.deletable) message.delete();
if(!args[0]) {
return message.reply("Please write your report").then(m => m.delete(10000));
}
if(!channel) {
return message.reply("There is no channel with name '#「❗」reports'").then(m => m.delete(10000));
}
const bugreportMessage = {
color: 51199,
author: {
name: "Report created by "+message.author.username,
icon_url: message.author.avatarURL
},
title: "New bug reported:",
url: "",
description: args.slice(0).join(" "),
thumbnail: {
url: message.author.avatarURL,
},
timestamp: new Date(),
footer: {
icon_url: client.user.avatarURL, text: "♛ Space Network"
}
}
message.channel.send("Sending your report to " + channel).then(m => m.delete(10000))
await channel.send({ embed: bugreportMessage });
}
}
Error: (node:8420) UnhandledPromiseRejectionWarning: DiscordAPIError: Unknown Message
at E:\GitHub\space-bot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15
at E:\GitHub\space-bot\node_modules\snekfetch\src\index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use node --trace-warnings ...
to show where the warning was created)
(node:8420) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:8420) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Discord when running the command: enter image description here
Console after run command: enter image description here