mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
feature: teams support (#3350)
* basic teams support * export Team & TeamMember * use typedef * typings and some fixes * Update src/structures/TeamMember.js Co-Authored-By: Vlad Frangu <kingdgrizzle@gmail.com> * fix Team#iconURL() * fix typings and a bug * fix states start at 1 * team icon hash can be null * fix owner typings
This commit is contained in:
@@ -145,6 +145,8 @@ exports.Endpoints = {
|
||||
makeImageUrl(`${root}/channel-icons/${channelID}/${hash}`, { size, format }),
|
||||
Splash: (guildID, hash, format = 'webp', size) =>
|
||||
makeImageUrl(`${root}/splashes/${guildID}/${hash}`, { size, format }),
|
||||
TeamIcon: (teamID, hash, { format = 'webp', size } = {}) =>
|
||||
makeImageUrl(`${root}/team-icons/${teamID}/${hash}`, { size, format }),
|
||||
};
|
||||
},
|
||||
invite: (root, code) => `${root}/${code}`,
|
||||
@@ -569,6 +571,19 @@ exports.DefaultMessageNotifications = [
|
||||
'MENTIONS',
|
||||
];
|
||||
|
||||
/**
|
||||
* The value set for a team members's membership state:
|
||||
* * INVITED
|
||||
* * ACCEPTED
|
||||
* @typedef {string} MembershipStates
|
||||
*/
|
||||
exports.MembershipStates = [
|
||||
// They start at 1
|
||||
null,
|
||||
'INVITED',
|
||||
'ACCEPTED',
|
||||
];
|
||||
|
||||
function keyMirror(arr) {
|
||||
let tmp = Object.create(null);
|
||||
for (const value of arr) tmp[value] = value;
|
||||
|
||||
Reference in New Issue
Block a user