@conflict/beta
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -18,2 +18,3 @@ import Discord, { | ||
import View from './view.js' | ||
import { getFile } from './utils.js' | ||
@@ -135,2 +136,3 @@ global.__ConflictViewParser = View.createElement; | ||
if (errorHandler) return errorHandler(err, interaction); | ||
const file = getFile(err); | ||
interaction.reply({ embeds: [ | ||
@@ -140,3 +142,3 @@ new MessageEmbed() | ||
.setTitle('Command Error') | ||
.setDescription('```' + err.stack + '```') | ||
.setDescription('```' + err.stack + '```\n\n```js\n' + file + '```') | ||
.setTimestamp() | ||
@@ -143,0 +145,0 @@ ] }); |
{ | ||
"name": "@conflict/beta", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "The first and only UI framework for Discord bots", | ||
@@ -5,0 +5,0 @@ "main": "exports.js", |
@@ -20,1 +20,10 @@ export function uuid () { | ||
} | ||
export function getFile (error) { | ||
let filePath = error.stack.split('\n')[1].split('(')[1].split(')')[0]; | ||
let lastColon = filePath.lastIndexOf(':'); | ||
filePath = filePath.substring(0, lastColon); | ||
lastColon = filePath.lastIndexOf(':'); | ||
filePath = filePath.substring(0, lastColon); | ||
return filePath; | ||
} |
28583
795