mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
add ClientUser#fetchMentions (#999)
* add ClientUser#fetchMentions Signed-off-by: Gus Caplan <gus@localhost.localdomain> * ugh * Update ClientUser.js * Update ClientUser.js * Update ClientUser.js
This commit is contained in:
committed by
Schuyler Cebulskie
parent
a0a3989e59
commit
e392107369
@@ -5,6 +5,7 @@ const parseEmoji = require('../../util/ParseEmoji');
|
||||
|
||||
const User = require('../../structures/User');
|
||||
const GuildMember = require('../../structures/GuildMember');
|
||||
const Message = require('../../structures/Message');
|
||||
const Role = require('../../structures/Role');
|
||||
const Invite = require('../../structures/Invite');
|
||||
const Webhook = require('../../structures/Webhook');
|
||||
@@ -564,6 +565,14 @@ class RESTMethods {
|
||||
);
|
||||
}
|
||||
|
||||
fetchMeMentions(options) {
|
||||
if (options.guild) options.guild = options.guild.id ? options.guild.id : options.guild;
|
||||
return this.rest.makeRequest(
|
||||
'get',
|
||||
Constants.Endpoints.meMentions(options.limit, options.roles, options.everyone, options.guild)
|
||||
).then(res => res.body.map(m => new Message(this.rest.client.channels.get(m.channel_id), m, this.rest.client)));
|
||||
}
|
||||
|
||||
addFriend(user) {
|
||||
return this.rest.makeRequest('post', Constants.Endpoints.relationships('@me'), true, {
|
||||
username: user.username,
|
||||
|
||||
Reference in New Issue
Block a user