mirror of
https://github.com/danbulant/discord.js
synced 2026-06-20 07:02:00 +00:00
Webpack build for branch master: 4ef0ec491c
This commit is contained in:
parent
37effae45b
commit
e9a3dfffe1
1 changed files with 37 additions and 37 deletions
|
|
@ -159,61 +159,61 @@ const Endpoints = exports.Endpoints = {
|
|||
logout: `${API}/auth/logout`,
|
||||
gateway: `${API}/gateway`,
|
||||
botGateway: `${API}/gateway/bot`,
|
||||
invite: (id) => `${API}/invite/${id}`,
|
||||
inviteLink: (id) => `https://discord.gg/${id}`,
|
||||
assets: (asset) => `${HOST}/assets/${asset}`,
|
||||
invite: id => `${API}/invite/${id}`,
|
||||
inviteLink: id => `https://discord.gg/${id}`,
|
||||
assets: asset => `${HOST}/assets/${asset}`,
|
||||
CDN: 'https://cdn.discordapp.com',
|
||||
|
||||
// users
|
||||
user: (userID) => `${API}/users/${userID}`,
|
||||
userChannels: (userID) => `${Endpoints.user(userID)}/channels`,
|
||||
userProfile: (userID) => `${Endpoints.user(userID)}/profile`,
|
||||
user: userID => `${API}/users/${userID}`,
|
||||
userChannels: userID => `${Endpoints.user(userID)}/channels`,
|
||||
userProfile: userID => `${Endpoints.user(userID)}/profile`,
|
||||
avatar: (userID, avatar) => {
|
||||
if (userID === '1') return avatar;
|
||||
return `${Endpoints.CDN}/avatars/${userID}/${avatar}.${avatar.startsWith('a_') ? 'gif' : 'jpg'}?size=1024`;
|
||||
},
|
||||
me: `${API}/users/@me`,
|
||||
meGuild: (guildID) => `${Endpoints.me}/guilds/${guildID}`,
|
||||
meGuild: guildID => `${Endpoints.me}/guilds/${guildID}`,
|
||||
meChannels: `${API}/users/@me/channels`,
|
||||
meMentions: (limit, roles, everyone, guildID) =>
|
||||
`users/@me/mentions?limit=${limit}&roles=${roles}&everyone=${everyone}${guildID ? `&guild_id=${guildID}` : ''}`,
|
||||
relationships: (userID) => `${Endpoints.user(userID)}/relationships`,
|
||||
note: (userID) => `${Endpoints.me}/notes/${userID}`,
|
||||
relationships: userID => `${Endpoints.user(userID)}/relationships`,
|
||||
note: userID => `${Endpoints.me}/notes/${userID}`,
|
||||
|
||||
voiceRegions: `${API}/voice/regions`,
|
||||
|
||||
// guilds
|
||||
guilds: `${API}/guilds`,
|
||||
guild: (guildID) => `${Endpoints.guilds}/${guildID}`,
|
||||
guild: guildID => `${Endpoints.guilds}/${guildID}`,
|
||||
guildIcon: (guildID, hash) => `${Endpoints.CDN}/icons/${guildID}/${hash}.jpg`,
|
||||
guildSplash: (guildID, hash) => `${Endpoints.CDN}/splashes/${guildID}/${hash}.jpg`,
|
||||
guildPrune: (guildID) => `${Endpoints.guild(guildID)}/prune`,
|
||||
guildEmbed: (guildID) => `${Endpoints.guild(guildID)}/embed`,
|
||||
guildInvites: (guildID) => `${Endpoints.guild(guildID)}/invites`,
|
||||
guildRoles: (guildID) => `${Endpoints.guild(guildID)}/roles`,
|
||||
guildPrune: guildID => `${Endpoints.guild(guildID)}/prune`,
|
||||
guildEmbed: guildID => `${Endpoints.guild(guildID)}/embed`,
|
||||
guildInvites: guildID => `${Endpoints.guild(guildID)}/invites`,
|
||||
guildRoles: guildID => `${Endpoints.guild(guildID)}/roles`,
|
||||
guildRole: (guildID, roleID) => `${Endpoints.guildRoles(guildID)}/${roleID}`,
|
||||
guildBans: (guildID) => `${Endpoints.guild(guildID)}/bans`,
|
||||
guildIntegrations: (guildID) => `${Endpoints.guild(guildID)}/integrations`,
|
||||
guildMembers: (guildID) => `${Endpoints.guild(guildID)}/members`,
|
||||
guildBans: guildID => `${Endpoints.guild(guildID)}/bans`,
|
||||
guildIntegrations: guildID => `${Endpoints.guild(guildID)}/integrations`,
|
||||
guildMembers: guildID => `${Endpoints.guild(guildID)}/members`,
|
||||
guildMember: (guildID, memberID) => `${Endpoints.guildMembers(guildID)}/${memberID}`,
|
||||
guildMemberRole: (guildID, memberID, roleID) => `${Endpoints.guildMember(guildID, memberID)}/roles/${roleID}`,
|
||||
guildMemberNickname: (guildID) => `${Endpoints.guildMember(guildID, '@me')}/nick`,
|
||||
guildChannels: (guildID) => `${Endpoints.guild(guildID)}/channels`,
|
||||
guildEmojis: (guildID) => `${Endpoints.guild(guildID)}/emojis`,
|
||||
guildMemberNickname: guildID => `${Endpoints.guildMember(guildID, '@me')}/nick`,
|
||||
guildChannels: guildID => `${Endpoints.guild(guildID)}/channels`,
|
||||
guildEmojis: guildID => `${Endpoints.guild(guildID)}/emojis`,
|
||||
guildEmoji: (guildID, emojiID) => `${Endpoints.guildEmojis(guildID)}/${emojiID}`,
|
||||
guildSearch: (guildID) => `${Endpoints.guild(guildID)}/messages/search`,
|
||||
guildVoiceRegions: (guildID) => `${Endpoints.guild(guildID)}/regions`,
|
||||
guildSearch: guildID => `${Endpoints.guild(guildID)}/messages/search`,
|
||||
guildVoiceRegions: guildID => `${Endpoints.guild(guildID)}/regions`,
|
||||
|
||||
// channels
|
||||
channels: `${API}/channels`,
|
||||
channel: (channelID) => `${Endpoints.channels}/${channelID}`,
|
||||
channelMessages: (channelID) => `${Endpoints.channel(channelID)}/messages`,
|
||||
channelInvites: (channelID) => `${Endpoints.channel(channelID)}/invites`,
|
||||
channelTyping: (channelID) => `${Endpoints.channel(channelID)}/typing`,
|
||||
channelPermissions: (channelID) => `${Endpoints.channel(channelID)}/permissions`,
|
||||
channel: channelID => `${Endpoints.channels}/${channelID}`,
|
||||
channelMessages: channelID => `${Endpoints.channel(channelID)}/messages`,
|
||||
channelInvites: channelID => `${Endpoints.channel(channelID)}/invites`,
|
||||
channelTyping: channelID => `${Endpoints.channel(channelID)}/typing`,
|
||||
channelPermissions: channelID => `${Endpoints.channel(channelID)}/permissions`,
|
||||
channelMessage: (channelID, messageID) => `${Endpoints.channelMessages(channelID)}/${messageID}`,
|
||||
channelWebhooks: (channelID) => `${Endpoints.channel(channelID)}/webhooks`,
|
||||
channelSearch: (channelID) => `${Endpoints.channelMessages(channelID)}/search`,
|
||||
channelWebhooks: channelID => `${Endpoints.channel(channelID)}/webhooks`,
|
||||
channelSearch: channelID => `${Endpoints.channelMessages(channelID)}/search`,
|
||||
|
||||
dmChannelRecipient: (channelID, recipientID) => `${Endpoints.channel(channelID)}/recipients/${recipientID}`,
|
||||
|
||||
|
|
@ -232,11 +232,11 @@ const Endpoints = exports.Endpoints = {
|
|||
webhook: (webhookID, token) => `${API}/webhooks/${webhookID}${token ? `/${token}` : ''}`,
|
||||
|
||||
// oauth
|
||||
oauth2Application: (appID) => `${API}/oauth2/applications/${appID}`,
|
||||
getApp: (id) => `${API}/oauth2/authorize?client_id=${id}`,
|
||||
oauth2Application: appID => `${API}/oauth2/applications/${appID}`,
|
||||
getApp: id => `${API}/oauth2/authorize?client_id=${id}`,
|
||||
|
||||
// emoji
|
||||
emoji: (emojiID) => `${Endpoints.CDN}/emojis/${emojiID}.png`,
|
||||
emoji: emojiID => `${Endpoints.CDN}/emojis/${emojiID}.png`,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -3360,7 +3360,7 @@ class Message {
|
|||
get cleanContent() {
|
||||
return this.content
|
||||
.replace(/@(everyone|here)/g, '@\u200b$1')
|
||||
.replace(/<@!?[0-9]+>/g, (input) => {
|
||||
.replace(/<@!?[0-9]+>/g, input => {
|
||||
const id = input.replace(/<|!|>|@/g, '');
|
||||
if (this.channel.type === 'dm' || this.channel.type === 'group') {
|
||||
return this.client.users.has(id) ? `@${this.client.users.get(id).username}` : input;
|
||||
|
|
@ -3376,12 +3376,12 @@ class Message {
|
|||
return input;
|
||||
}
|
||||
})
|
||||
.replace(/<#[0-9]+>/g, (input) => {
|
||||
.replace(/<#[0-9]+>/g, input => {
|
||||
const channel = this.client.channels.get(input.replace(/<|#|>/g, ''));
|
||||
if (channel) return `#${channel.name}`;
|
||||
return input;
|
||||
})
|
||||
.replace(/<@&[0-9]+>/g, (input) => {
|
||||
.replace(/<@&[0-9]+>/g, input => {
|
||||
if (this.channel.type === 'dm' || this.channel.type === 'group') return input;
|
||||
const role = this.guild.roles.get(input.replace(/<|@|>|&/g, ''));
|
||||
if (role) return `@${role.name}`;
|
||||
|
|
@ -23197,7 +23197,7 @@ class RESTMethods {
|
|||
const messages = [];
|
||||
(function sendChunk(list, index) {
|
||||
const options = index === list.length ? { tts, embed } : { tts };
|
||||
chan.send(list[index], options, index === list.length ? file : null).then((message) => {
|
||||
chan.send(list[index], options, index === list.length ? file : null).then(message => {
|
||||
messages.push(message);
|
||||
if (index >= list.length - 1) return resolve(messages);
|
||||
return sendChunk(list, ++index);
|
||||
|
|
@ -23954,7 +23954,7 @@ class RESTMethods {
|
|||
acceptInvite(code) {
|
||||
if (code.id) code = code.id;
|
||||
return new Promise((resolve, reject) =>
|
||||
this.rest.makeRequest('post', Constants.Endpoints.invite(code), true).then((res) => {
|
||||
this.rest.makeRequest('post', Constants.Endpoints.invite(code), true).then(res => {
|
||||
const handler = guild => {
|
||||
if (guild.id === res.id) {
|
||||
resolve(guild);
|
||||
|
|
|
|||
Loading…
Reference in a new issue