1
1
//=====================================| Import the Module |=====================================\
2
2
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' ) ;
4
4
const { errorCmdLogsInt } = require ( `../../Structures/Functions/errorCmdLogs.js` ) ;
5
5
const { onCoolDownInt } = require ( `../../Structures/Functions/onCoolDown.js` ) ;
6
6
const Settings = require ( `../../Structures/Settings/settings.json` ) ;
@@ -18,9 +18,8 @@ module.exports = {
18
18
19
19
/**
20
20
*
21
- * @param {ChatInputCommandInteraction } interaction
21
+ * @param {CommandInteraction } interaction
22
22
* @param {Client } client
23
- * @returns
24
23
*/
25
24
26
25
async execute ( interaction , client ) {
@@ -36,7 +35,18 @@ module.exports = {
36
35
if ( interaction . user . bot ) return ;
37
36
38
37
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
+ } ;
40
50
41
51
const args = [ ] ;
42
52
@@ -62,7 +72,7 @@ module.exports = {
62
72
. setColor ( Embed . Colors . wrongcolor )
63
73
. setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
64
74
. 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 ( ) } )
66
76
] ,
67
77
components : [
68
78
new ActionRowBuilder ( ) . addComponents (
@@ -82,7 +92,7 @@ module.exports = {
82
92
. setColor ( Embed . Colors . wrongcolor )
83
93
. setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
84
94
. 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 ( ) } )
86
96
] ,
87
97
components : [
88
98
new ActionRowBuilder ( ) . addComponents (
@@ -101,7 +111,7 @@ module.exports = {
101
111
. setColor ( Embed . Colors . wrongcolor )
102
112
. setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
103
113
. 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 ( ) } )
105
115
]
106
116
} )
107
117
}
@@ -115,7 +125,7 @@ module.exports = {
115
125
. setColor ( Embed . Colors . wrongcolor )
116
126
. setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
117
127
. 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 ( ) } )
119
129
]
120
130
} )
121
131
}
@@ -129,7 +139,7 @@ module.exports = {
129
139
. setColor ( Embed . Colors . wrongcolor )
130
140
. setTitle ( `${ Emoji . Message . ERROR } You can't use this Command!` )
131
141
. 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 ( ) } )
133
143
]
134
144
} )
135
145
}
@@ -142,7 +152,7 @@ module.exports = {
142
152
new EmbedBuilder ( )
143
153
. setColor ( Embed . Colors . wrongcolor )
144
154
. 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 ( ) } )
146
156
]
147
157
} )
148
158
}
@@ -155,7 +165,7 @@ module.exports = {
155
165
new EmbedBuilder ( )
156
166
. setColor ( Embed . Colors . wrongcolor )
157
167
. 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 ( ) } )
159
169
]
160
170
} )
161
171
}
@@ -168,21 +178,21 @@ module.exports = {
168
178
new EmbedBuilder ( )
169
179
. setColor ( Embed . Colors . wrongcolor )
170
180
. 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 ( ) } )
172
182
]
173
183
} )
174
184
}
175
185
176
186
// ====================< Cooldown Check InterrorCmdLogsInt=================== \\
177
- if ( command . cooldown && onCoolDownInt ( interaction , command ) ) {
187
+ if ( onCoolDownInt ( interaction , command ) ) {
178
188
return interaction . reply ( {
179
189
ephemeral : true ,
180
190
embeds : [
181
191
new EmbedBuilder ( )
182
192
. setColor ( Embed . Colors . wrongcolor )
183
193
. 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 ( ) } )
186
196
]
187
197
} )
188
198
}
@@ -200,7 +210,7 @@ module.exports = {
200
210
. setDescription ( `${ Emoji . Message . ERROR } There was an error trying to execute that command!` )
201
211
. setDescription ( `There was an error trying to execute that command.` )
202
212
. addField ( 'Error' , `\`\`\`${ error } \`\`\`` )
203
- . setFooter ( `${ Embed . footertext } · v${ version } ` , client . user . displayAvatarURL ( ) )
213
+ . setFooter ( { text : `${ Embed . footertext } · v${ version } ` , iconURL : client . user . displayAvatarURL ( ) } )
204
214
]
205
215
} )
206
216
}
0 commit comments