#I dont think I was wrong. I want if it has 6 digits to return a message but they are only numeric.
1 messages · Page 1 of 1 (latest)
So you have an output, and if it has less than 6 digits, you want to delete the reply?
but they are only numeric.
I'm pretty sure digits are always numeric, no matter what digits
But # is not a digit
yes i see
Then you want to check the amount of digits in the whole message.content?
I'll fix this later with starts.with. my problem now is with the numbers
If you do get numbers, which you suggest, but I doubt, you can check if the number has at least 6 digits with: number / 100000 > 0
yes
Actually it is overdone, you can check easier with number > 99999
my command basic
client.on('message', message => {
if (message.author.bot) return;
if (message.channel.type == 'dm') return;
if (message.content.length > 6) return message.delete()
return message.channel.send('this is')
})
What your command does is: deleting the message if message.content (which includes #) has more than 6 chars
Probably you want if(message.content.substring(...).length < 6) ...
I just want that if it has 6 digits return the message
And what if it has less than 6?
if you have 6 I just need it now
I meant, what if there are more or less than 6 digits in the message?
Do you still have to return a message?
not only 6 numbers return message. if you don't have the command it won't even work
client.on('message', message => {
if (message.author.bot) return;
if (message.channel.type == 'dm') return;
if (!message.content.startsWith(`#`)) return;
let token_length = `#`.length;
if (message.content.length - token_length != 6) return message.delete();
return message.channel.send('this is');
});
Also, take note that message event is likely deprecated
wtf
token length is not a defined
oh yes
your edit
that's what you sent delete just #
forgets this #
Only Numbers
Numbers
not substring
What is proposal? Are you making a bot for someone else?
Can you please answer my last questions? Otherwise someone else can come here and help you
What is proposal? Are you making a bot for someone else?
Ok, well, not that I really care...:
if (isNaN(message.content) || message.content.length != 6) return message.delete();
return message.channel.send('this is');
What's the deal?
Do you not know what || means?
Yes
Any other text IS NOT a 6 digit number
Sorry, but your english seems kinda broken, so it's hard to understand you... You want to filter only numbers?
Which means letting all random text pass-through
Yes
Yes
Yes
if (!isNaN(message.content) && message.content.length != 6) return message.delete();
Your messages got deleted, maybe a mod banned you?