Please describe the problem you are having in as much detail as possible:
If the user types the command so that the bot creates a channel that contains the user ID (message.author.id) then it can do it once. If you create a channel for the second time, you will not be able to. This is a blockade. That's my goal. The code below shows it. In case I would like the bot to create a channel with the username (message.author.username), it can make as many channels as it wants. It should not be like that. It should be like with ID.
Video showing the whole problem:
https://youtu.be/QaTYJRxbLvI
Include a reproducible code sample here, if possible:
With user ID.
if (message.guild.channels.exists("name", "ticket" + message.author.id)) return message.channel.send({ embed: whylol });
message.guild.createChannel(`ticket${message.author.id}`, "text").then(c => {
With user username.
if (message.guild.channels.exists("name", "ticket" + message.author.username)) return message.channel.send({ embed: whylol });
message.guild.createChannel(`ticket${message.author.username}`, "text").then(c => {
Further details:
The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the Discord server instead of opening an issue – you will get redirected there anyway.
This is not a bug, lol?
No, it's not. All IDs are snowflakes, or in other words, +17 digit numbers (we have them as strings them due to IEEE 754's lack of accuracy over 16 digits) that never change. Usernames are another thing and can be changed (same with the discriminator number). Your issue is most likely caused by your code as Collection#exists works perfectly (and I have just tested it).
that's becuz the channel's name is lowercase, ur message.author.username might have uppercase (or anything that is illegal in a channel's name) thus making the .exists failed
either u do a check and turn the message.author.username into something that is channel-name-able, or use userID for it
Most helpful comment
that's becuz the channel's name is lowercase, ur message.author.username might have uppercase (or anything that is illegal in a channel's name) thus making the .exists failed
either u do a check and turn the message.author.username into something that is channel-name-able, or use userID for it