33 APIEmbed ,
44 ButtonInteraction ,
55 Channel ,
6+ ChatInputCommandInteraction ,
67 Client ,
7- CommandInteraction ,
88 Guild ,
99 GuildChannel ,
1010 inlineCode ,
@@ -65,9 +65,15 @@ export const serverNotificationEmbed = async ({
6565export const sendErrorLog = async ( {
6666 error,
6767 interaction,
68+ option,
69+ subCommand,
70+ customTitle,
6871} : {
6972 error : any ;
70- interaction ?: CommandInteraction ;
73+ interaction ?: ChatInputCommandInteraction | AnySelectMenuInteraction | ButtonInteraction ;
74+ option ?: string | null ;
75+ subCommand ?: string ;
76+ customTitle ?: string ;
7177} ) => {
7278 console . error ( error ) ;
7379 const errorID = uuid ( ) ;
@@ -78,14 +84,22 @@ export const sendErrorLog = async ({
7884 } \nError ID: ${ inlineCode ( errorID ) } `,
7985 color : getEmbedColor ( '#FF0000' ) ,
8086 } ;
81- await interaction . editReply ( { embeds : [ errorEmbed ] } ) ;
87+ await interaction . editReply ( { embeds : [ errorEmbed ] , components : [ ] } ) ;
8288 }
8389 if ( ERROR_NOTIFICATION_WEBHOOK_URL && ! isEmpty ( ERROR_NOTIFICATION_WEBHOOK_URL ) ) {
8490 const interactionChannel = interaction ?. channel as GuildChannel | undefined ;
8591 const notificationEmbed : APIEmbed = {
86- title : interaction ? `Error | ${ capitalize ( interaction . commandName ) } Command` : 'Error' ,
92+ title : customTitle
93+ ? `Error | ${ customTitle } `
94+ : interaction
95+ ? `Error | ${ interaction . isCommand ( ) ? capitalize ( interaction . commandName ) : '' } ${
96+ subCommand ? ` ${ capitalize ( subCommand ) } ` : ''
97+ } Command`
98+ : 'Error' ,
8799 color : getEmbedColor ( '#FF0000' ) ,
88- description : `uuid: ${ errorID } \nError: ${ error . message ? error . message : 'Unexpected Error' } ` ,
100+ description : `uuid: ${ errorID } \nError: ${
101+ error . message ? error . message : 'Unexpected Error'
102+ } \n${ option ? `Option: ${ option } ` : '' } `,
89103 fields : interaction
90104 ? [
91105 {
0 commit comments