How to create a channel then find the ID

Will

I am creating a channel with message.guild.channels.create. How do I go about then finding the message id of that channel and sending a message in the newly created channel?

message.guild.channels.create(`bug-priority${reportPriority}-${reportStart}`, {
  type: 'text',
  permissionOverwrites: [{
    id: message.author.id,
    allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
  },
  {
    id: memberRole.id,
    deny: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
  }]
})
Zsolt Meszaros

guild.channels.create returns a promise that resolves to a GuildChannel. It means you can await the result and that's the newly created channel:

const channel = await message.guild.channels.create(`bug-priority${reportPriority}-${reportStart}`, {
  type: 'text',
  permissionOverwrites: [
    {
      id: message.author.id,
      allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
    },

    {
      id: memberRole.id,
      deny: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
    },
  ],
});

const { id } = channel;

Make sure that the parent function is an async fucntion.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to create a channel then find the ID

From Dev

How to create channel with socket in Python

From Dev

How to create a LIFO Queue Channel

From Dev

How to create a Discord channel with parent?

From Dev

How to create voice channel link

From Dev

How to create channel with socket in Python

From Dev

How to create a custom channel in SystemC?

From Dev

How to create a channel path with BigQuery?

From Dev

How to create a notification channel group?

From Java

What is the simplest way to find a slack team ID and a channel ID?

From Dev

How to find channel by name DiscordJS 12

From Dev

How to find all the "subchannels" available in a snap channel?

From Dev

How to create a channel from another with transducers?

From Dev

How to create channel interceptor programmatically in spring

From Dev

How to create channel interceptor programmatically in spring

From Dev

How to get the id of the channel after creating it

From Dev

How to get the youtube channel ID and name, given a video ID

From Dev

How to find by foreign id?

From Dev

How to find out a date a follower started following a certain channel on twitch?

From Dev

How can I find the latest video on a Vimeo channel with JSON?

From Dev

How to find out a date a follower started following a certain channel on twitch?

From Dev

How to create an occurrence counter in MySQL ,each time the counter find the id it occurrence increases?

From Dev

i Have written this membership class, how can i create a method to find a specific ID given to a member?

From Dev

Ruby on rails "Could find user with id= create"

From Dev

How to create a category and a channel using python discord.py

From Java

How to obtain the chat_id of a private Telegram channel?

From Dev

How does TLS Channel ID guarantee client authenticity?

From Dev

How to get YouTube channel information from Google+ ID

From Dev

How to tell the difference between a channel ID and YouTube username?

Related Related

  1. 1

    How to create a channel then find the ID

  2. 2

    How to create channel with socket in Python

  3. 3

    How to create a LIFO Queue Channel

  4. 4

    How to create a Discord channel with parent?

  5. 5

    How to create voice channel link

  6. 6

    How to create channel with socket in Python

  7. 7

    How to create a custom channel in SystemC?

  8. 8

    How to create a channel path with BigQuery?

  9. 9

    How to create a notification channel group?

  10. 10

    What is the simplest way to find a slack team ID and a channel ID?

  11. 11

    How to find channel by name DiscordJS 12

  12. 12

    How to find all the "subchannels" available in a snap channel?

  13. 13

    How to create a channel from another with transducers?

  14. 14

    How to create channel interceptor programmatically in spring

  15. 15

    How to create channel interceptor programmatically in spring

  16. 16

    How to get the id of the channel after creating it

  17. 17

    How to get the youtube channel ID and name, given a video ID

  18. 18

    How to find by foreign id?

  19. 19

    How to find out a date a follower started following a certain channel on twitch?

  20. 20

    How can I find the latest video on a Vimeo channel with JSON?

  21. 21

    How to find out a date a follower started following a certain channel on twitch?

  22. 22

    How to create an occurrence counter in MySQL ,each time the counter find the id it occurrence increases?

  23. 23

    i Have written this membership class, how can i create a method to find a specific ID given to a member?

  24. 24

    Ruby on rails "Could find user with id= create"

  25. 25

    How to create a category and a channel using python discord.py

  26. 26

    How to obtain the chat_id of a private Telegram channel?

  27. 27

    How does TLS Channel ID guarantee client authenticity?

  28. 28

    How to get YouTube channel information from Google+ ID

  29. 29

    How to tell the difference between a channel ID and YouTube username?

HotTag

Archive