11//=====================================| Import the Module |=====================================\
22
3- const { ChatInputCommandInteraction , EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Collection, PermissionsBitField, ChannelType } = require ( 'discord.js' ) ;
3+ const { CommandInteraction , EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Collection, PermissionsBitField, ChannelType } = require ( 'discord.js' ) ;
44const { errorCmdLogsInt } = require ( `../../Structures/Functions/errorCmdLogs.js` ) ;
55const { onCoolDownInt } = require ( `../../Structures/Functions/onCoolDown.js` ) ;
66const Settings = require ( `../../Structures/Settings/settings.json` ) ;
@@ -18,9 +18,8 @@ module.exports = {
1818
1919 /**
2020 *
21- * @param {ChatInputCommandInteraction } interaction
21+ * @param {CommandInteraction } interaction
2222 * @param {Client } client
23- * @returns
2423 */
2524
2625 async execute ( interaction , client ) {
@@ -36,7 +35,18 @@ module.exports = {
3635 if ( interaction . user . bot ) return ;
3736
3837 const command = client . slash . get ( interaction . commandName ) ;
39- if ( ! command ) return client . slash . delete ( interaction . commandName ) ;
38+ if ( ! command ) {
39+ return interaction . reply ( {
40+ ephemeral : true ,
41+ embeds : [
42+ new EmbedBuilder ( )
43+ . setColor ( Embed . Colors . wrongcolor )
44+ . setTitle ( `${ Emoji . Message . No } ${ interaction . user . username } You have entered an invalid command!` )
45+ . setDescription ( `The command \`${ interaction . commandName } \` is outdated.\nPlease use \`${ prefix } help\` to see all the commands.` )
46+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
47+ ]
48+ } ) ;
49+ } ;
4050
4151 const args = [ ] ;
4252
@@ -62,7 +72,7 @@ module.exports = {
6272 . setColor ( Embed . Colors . wrongcolor )
6373 . setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
6474 . setDescription ( `The command \`${ interaction . commandName } \` can only be used by Developer.` )
65- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
75+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
6676 ] ,
6777 components : [
6878 new ActionRowBuilder ( ) . addComponents (
@@ -82,7 +92,7 @@ module.exports = {
8292 . setColor ( Embed . Colors . wrongcolor )
8393 . setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
8494 . setDescription ( `The command \`${ interaction . commandName } \` can only be used in the official server.` )
85- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
95+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
8696 ] ,
8797 components : [
8898 new ActionRowBuilder ( ) . addComponents (
@@ -101,7 +111,7 @@ module.exports = {
101111 . setColor ( Embed . Colors . wrongcolor )
102112 . setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
103113 . setDescription ( `The command \`${ interaction . commandName } \` has been disabled by the Developer! Please try again later.` )
104- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
114+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
105115 ]
106116 } )
107117 }
@@ -115,7 +125,7 @@ module.exports = {
115125 . setColor ( Embed . Colors . wrongcolor )
116126 . setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
117127 . setDescription ( `The command \`${ interaction . commandName } \` has been maintenance, because the command is currently bug fixed! Please try again later.` )
118- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
128+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
119129 ]
120130 } )
121131 }
@@ -129,7 +139,7 @@ module.exports = {
129139 . setColor ( Embed . Colors . wrongcolor )
130140 . setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
131141 . setDescription ( `The command \`${ interaction . commandName } \` only can use if you join to the voice! Please join to voice and Please try again later.` )
132- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
142+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
133143 ]
134144 } )
135145 }
@@ -142,7 +152,7 @@ module.exports = {
142152 new EmbedBuilder ( )
143153 . setColor ( Embed . Colors . wrongcolor )
144154 . setDescription ( `${ Emoji . Message . ERROR } This command can only be used in NSFW channels!` )
145- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
155+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
146156 ]
147157 } )
148158 }
@@ -155,7 +165,7 @@ module.exports = {
155165 new EmbedBuilder ( )
156166 . setColor ( Embed . Colors . wrongcolor )
157167 . setDescription ( `${ Emoji . Message . ERROR } I don't have the required permissions to use this command\n \`${ command . botPerms . join ( `, ` ) } \`` )
158- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
168+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
159169 ]
160170 } )
161171 }
@@ -168,21 +178,21 @@ module.exports = {
168178 new EmbedBuilder ( )
169179 . setColor ( Embed . Colors . wrongcolor )
170180 . setDescription ( `${ Emoji . Message . ERROR } You don't have the required permissions to use this command\n \`${ command . userPerms . join ( `, ` ) } \`` )
171- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
181+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
172182 ]
173183 } )
174184 }
175185
176186 // ====================< Cooldown Check InterrorCmdLogsInt=================== \\
177- if ( command . cooldown && onCoolDownInt ( interaction , command ) ) {
187+ if ( onCoolDownInt ( interaction , command ) ) {
178188 return interaction . reply ( {
179189 ephemeral : true ,
180190 embeds : [
181191 new EmbedBuilder ( )
182192 . setColor ( Embed . Colors . wrongcolor )
183193 . setTitle ( `${ Emoji . Message . ERROR } You have been cooldown for \`${ command . cooldown } \` seconds!` )
184- . setDescription ( `Please wait \`${ onCoolDownInt ( interaction , command ) . toFixed ( 1 ) } \` Before using the \`${ command . name } \` command again!` )
185- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
194+ . setDescription ( `Please wait \`${ onCoolDownInt ( interaction , command ) . toFixed ( 1 ) } \` Before using the \`${ interaction . commandName } \` command again!` )
195+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
186196 ]
187197 } )
188198 }
@@ -200,7 +210,7 @@ module.exports = {
200210 . setDescription ( `${ Emoji . Message . ERROR } There was an error trying to execute that command!` )
201211 . setDescription ( `There was an error trying to execute that command.` )
202212 . addField ( 'Error' , `\`\`\`${ error } \`\`\`` )
203- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
213+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
204214 ]
205215 } )
206216 }
0 commit comments