About channel types! #8025
-
| Hello. I could put only the text channels to appear without us having to make a Work around (in slash) type: 'CHANNEL',
interaction.options.getChannel("bla");But I just wanted the text channels ;-; without using If it could be like this: interaction.options.getTextChannel("bla"); | 
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
| Here is an example that could be a perfect command just click here to see..... | 
Beta Was this translation helpful? Give feedback.
-
| Often we need to make a Work around and this is very annoying..... | 
Beta Was this translation helpful? Give feedback.
        
          
            
              This comment was marked as disruptive content.
            
          
            
        
      
    
            
              This comment was marked as disruptive content.
            
          
            
        -
| If you are running  Example: client.application.commands.create({
  name: 'test',
  description: 'A test command',
  options: [{
     type: ApplicationCommandOptionType.Channel,
     name: 'channel',
     description: 'Choose a channel.',
     channelTypes: [ChannelType.GuildText]
    }]
  }) | 
Beta Was this translation helpful? Give feedback.
-
| Sorted out ,-, | 
Beta Was this translation helpful? Give feedback.
If you are running
discordjs@dev, you can create a command normally, and in the channel option, you can use thechannelTypesproperty to tell what types of channels will be allowed.Example: