mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 17:13:31 +01:00
setChannelPosition
This commit is contained in:
@@ -877,6 +877,23 @@ export default class InternalClient {
|
||||
);
|
||||
}
|
||||
|
||||
//def setTopic
|
||||
setChannelPosition(chann, position = 0) {
|
||||
return this.resolver.resolveChannel(chann)
|
||||
.then(channel =>
|
||||
request
|
||||
.patch(Endpoints.CHANNEL(channel.id))
|
||||
.set("authorization", this.token)
|
||||
.send({
|
||||
name: channel.name,
|
||||
position: position,
|
||||
topic: channel.topic
|
||||
})
|
||||
.end()
|
||||
.then(res => channel.position = res.body.position)
|
||||
);
|
||||
}
|
||||
|
||||
//def updateChannel
|
||||
updateChannel(chann, data) {
|
||||
return this.setChannelNameAndTopic(chann, data.name, data.topic);
|
||||
|
||||
Reference in New Issue
Block a user