Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add permissionOverwrites option when creating guild channels #544

Merged
merged 2 commits into from
Oct 18, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ class Client extends EventEmitter {
* @arg {Number} [options.userLimit] The channel user limit (voice channels only)
* @arg {Number} [options.rateLimitPerUser] The time in seconds a user has to wait before sending another message (does not affect bots or users with manageMessages/manageChannel permissions) (text channels only)
* @arg {String?} [options.parentID] The ID of the parent channel category for this channel
* @arg {Array} [options.permissionOverwrites] An array containing overwrite objects
Astraeus- marked this conversation as resolved.
Show resolved Hide resolved
* @returns {Promise<CategoryChannel | TextChannel | VoiceChannel>}
*/
createChannel(guildID, name, type, reason, options = {}) {
Expand All @@ -397,7 +398,8 @@ class Client extends EventEmitter {
bitrate: options.bitrate,
user_limit: options.userLimit,
rate_limit_per_user: options.rateLimitPerUser,
parent_id: options.parentID
parent_id: options.parentID,
permission_overwrites: options.permissionOverwrites
}).then((channel) => {
if(channel.type === 2) {
return new VoiceChannel(channel, guild);
Expand Down
1 change: 1 addition & 0 deletions lib/structures/Guild.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ class Guild extends Base {
* @arg {Number} [options.userLimit] The channel user limit (voice channels only)
* @arg {Number} [options.rateLimitPerUser] The time in seconds a user has to wait before sending another message (does not affect bots or users with manageMessages/manageChannel permissions) (text channels only)
* @arg {String?} [options.parentID] The ID of the parent channel category for this channel
* @arg {Array} [options.permissionOverwrites] An array containing overwrite objects
* @returns {Promise<CategoryChannel | TextChannel | VoiceChannel>}
*/
createChannel(name, type, reason, options) {
Expand Down