You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CreateChannel: ability to use this class similar like Discord.js to create new channels, set parent (category), set position (position of the channel in a category), and send message to a specific channel.
let{ CreateChannel }=require('@notedwin/autocode-discordjs');letevent=context.params.event;/** CreateChannel.create(name, { guild_id, type, topic, bitrate, user_limit, rate_limit_per_user, position, permission_overwrites, parent_id, nsfw }); * bitrate and user_limit is only applicable for voice channels and stage channels. * check out more about bitrates here by reading the * section: https://discord.com/developers/docs/resources/channel#modify-channel-json-params-guild-channel * Check out more about channel type here: https://discord.com/developers/docs/resources/channel#channel-object-channel-types */letchannel=newCreateChannel(event);letcreatedChannel=awaitchannel.create('test-channel',{type: 0,//for now, you will have to use the integer type from Discord Dev Portal. An alternative way is coming soon.topic: `channel topic here`,//optional})/** replace the data with the created channel's data if you wanna update the created channel's info. * use the original context.params.event if you wanna update the current channel's info instead. */channel=newCreateChannel(createdChannel)awaitchannel.setName('new-channel-name')awaitchannel.setParent('891309033884094525')