mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 18:13:29 +01:00
Expose TextBasedChannel#fetchMessage() (#602)
This commit is contained in:
@@ -287,6 +287,18 @@ class RESTMethods {
|
||||
});
|
||||
}
|
||||
|
||||
getChannelMessage(channel, messageID) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const msg = channel.messages.get(messageID);
|
||||
if (msg) return resolve(msg);
|
||||
|
||||
const endpoint = Constants.Endpoints.channelMessage(channel.id, messageID);
|
||||
return this.rest.makeRequest('get', endpoint, true)
|
||||
.then(resolve)
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
|
||||
updateGuildMember(member, data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (data.channel) data.channel_id = this.rest.client.resolver.resolveChannel(data.channel).id;
|
||||
|
||||
Reference in New Issue
Block a user