fix ratelimit

This commit is contained in:
1e99 2025-07-22 23:22:24 +02:00
parent efc138e117
commit 0030ee4dd4

View file

@ -29,15 +29,6 @@ export default class Commands {
return
}
const args = message
.substring(this.#prefix.length)
.split(" ")
// Just to be safe
if (args.length < 1) {
return
}
let ratelimit = this.#ratelimit.get(username)
if (ratelimit === undefined) {
ratelimit = 0
@ -50,6 +41,15 @@ export default class Commands {
return
}
const args = message
.substring(this.#prefix.length)
.split(" ")
// Just to be safe
if (args.length < 1) {
return
}
for (const command of this.#commands) {
if (command.name !== args[0]) {
continue