|
53 | 53 | addPin: (channelId, messageId) => apiCall(`/channels/${channelId}/pins/${messageId}`, null, 'PUT'),
|
54 | 54 | deletePin: (channelId, messageId) => apiCall(`/channels/${channelId}/pins/${messageId}`, null, 'DELETE'),
|
55 | 55 |
|
| 56 | + listEmojis: guildId => apiCall(`/guilds/${guildId}/emojis`), |
| 57 | + getEmoji: (guildId, emojiId) => apiCall(`/guilds/${guildId}/emojis/${emojiId}`), |
| 58 | + createEmoji: (guildId, name, image, roles) => apiCall(`/guilds/${guildId}`, { name, image, roles }, 'POST'), |
| 59 | + editEmoji: (guildId, emojiId, name, roles) => apiCall(`/guilds/${guildId}/${emojiId}`, { name, roles }, 'PATCH'), |
| 60 | + deleteEmoji: (guildId, emojiId) => apiCall(`/guilds/${guildId}/${emojiId}`, null, 'DELETE'), |
| 61 | + |
56 | 62 | changeNick: (guildId, nick) => apiCall(`/guilds/${guildId}/members/@me/nick`, { nick }, 'PATCH'),
|
57 | 63 | leaveServer: guildId => apiCall(`/users/@me/guilds/${guildId}`, null, 'DELETE'),
|
58 | 64 |
|
59 | 65 | getDMs: () => apiCall(`/users/@me/channels`),
|
60 | 66 | getUser: userId => apiCall(`/users/${userId}`),
|
61 | 67 |
|
| 68 | + getCurrentUser: () => apiCall('/users/@me'), |
| 69 | + editCurrentUser: (username, avatar) => apiCall('/users/@me', { username, avatar }, 'PATCH'), |
| 70 | + listCurrentUserGuilds: () => apiCall('/users/@me/guilds'), |
| 71 | + |
| 72 | + listReactions: (channelId, messageId, emojiUrl) => apiCall(`/channels/${channelId}/messages/${messageId}/reactions/${emojiUrl}/@me`), |
62 | 73 | addReaction: (channelId, messageId, emojiUrl) => apiCall(`/channels/${channelId}/messages/${messageId}/reactions/${emojiUrl}/@me`, null, 'PUT'),
|
63 | 74 | deleteReaction: (channelId, messageId, emojiUrl) => apiCall(`/channels/${channelId}/messages/${messageId}/reactions/${emojiUrl}/@me`, null, 'DELETE'),
|
64 | 75 |
|
|
78 | 89 | var cid = '' // Current channel id
|
79 | 90 |
|
80 | 91 | // Call this to update `cid` and `gid` to current channel and guild id
|
81 |
| - var id = () => { |
| 92 | + var id = (log = true) => { |
82 | 93 | gid = window.location.href.split('/').slice(4)[0]
|
83 | 94 | cid = window.location.href.split('/').slice(4)[1]
|
| 95 | + if (log) { |
| 96 | + console.log(`\`gid\` was set to the guild id you are currently looking at (${gid})`) |
| 97 | + console.log(`\`cid\` was set to the channel id you are currently looking at (${cid})`) |
| 98 | + } |
84 | 99 | }
|
85 |
| - id() |
| 100 | + id(false) |
86 | 101 |
|
87 | 102 | // Set your `Authorization` token here
|
88 | 103 | var authHeader = ''
|
|
0 commit comments