jalter
Version:
<a href="https://scathach.dev"><img align="right" src="https://cdn.discordapp.com/attachments/711217607876804629/932506038865911848/alter.png" width=28%></a>
635 lines (397 loc) • 17.9 kB
Markdown
## rest : <code>\*</code>
**Kind**: global variable
* [rest](#rest) : <code>\*</code>
* [.getMessages(channelID, params)](#rest.getMessages) ⇒ <code>Promise.<Message></code>
* [.sendMessage(channelID, content, options)](#rest.sendMessage) ⇒ <code>Promise.<Message></code>
* [.editMessage(channelID, messageID, content, options)](#rest.editMessage) ⇒ <code>Promise.<Message></code>
* [.deleteMessage(channelID, messageID)](#rest.deleteMessage) ⇒ <code>Promise.<Message></code>
* [.sendEmbed(channelID, embed)](#rest.sendEmbed) ⇒ <code>Promise.<Message></code>
* [.auditLog(guildID)](#rest.auditLog) ⇒ <code>Promise.<Message></code>
* [.getRoles(guildID)](#rest.getRoles) ⇒ <code>Promise.<Message></code>
* [.createRole(guildID, options)](#rest.createRole) ⇒ <code>Promise.<Message></code>
* [.deleteRole(guildID, roleID)](#rest.deleteRole) ⇒ <code>Promise.<Message></code>
* [.getBans(guildID)](#rest.getBans) ⇒ <code>Promise.<Message></code>
* [.banUser(guildID, userID, reason)](#rest.banUser) ⇒ <code>Promise.<Message></code>
* [.unbanUser(guildID, userID)](#rest.unbanUser) ⇒ <code>Promise.<Message></code>
* [.kickUser(guildID, userID)](#rest.kickUser) ⇒ <code>Promise.<Message></code>
* [.addRole(guildID, userID, roleID)](#rest.addRole) ⇒ <code>Promise.<Message></code>
* [.removeRole(guildID, userID, roleID)](#rest.removeRole) ⇒ <code>Promise.<Message></code>
* [.getChannels(guildID)](#rest.getChannels) ⇒ <code>Promise.<Message></code>
* [.createChannel(guildID, options, options)](#rest.createChannel) ⇒ <code>Promise.<Message></code>
* [.pinnedMessages(channelID)](#rest.pinnedMessages) ⇒ <code>Promise.<Message></code>
* [.addPin(channelID, messageID)](#rest.addPin) ⇒ <code>Promise.<Message></code>
* [.deletePin(channelID, messageID)](#rest.deletePin) ⇒ <code>Promise.<Message></code>
* [.listEmojis(guildID)](#rest.listEmojis) ⇒ <code>Promise.<Message></code>
* [.getEmoji(guildID, emojiID)](#rest.getEmoji) ⇒ <code>Promise.<Message></code>
* [.createEmoji(guildID, name, image, roles)](#rest.createEmoji) ⇒ <code>Promise.<Message></code>
* [.editEmoji(guildID, emojiID, name, roles)](#rest.editEmoji) ⇒ <code>Promise.<Message></code>
* [.deleteEmoji(guildID, emojiID)](#rest.deleteEmoji) ⇒ <code>Promise.<Message></code>
* [.changeNick(guildID, nick)](#rest.changeNick) ⇒ <code>Promise.<Message></code>
* [.leaveServer(guildID)](#rest.leaveServer) ⇒ <code>Promise.<Message></code>
* [.getDMs()](#rest.getDMs) ⇒ <code>Promise.<Message></code>
* [.getUser(userID)](#rest.getUser) ⇒ <code>Promise.<Message></code>
* [.getCurrentUser()](#rest.getCurrentUser) ⇒ <code>Promise.<Message></code>
* [.editCurrentUser(options, options)](#rest.editCurrentUser) ⇒ <code>Promise.<Message></code>
* [.listCurrentUserGuilds()](#rest.listCurrentUserGuilds) ⇒ <code>Promise.<Message></code>
* [.listReactions(channelID, messageID, emojiUrl)](#rest.listReactions) ⇒ <code>Promise.<Message></code>
* [.addReaction(channelID, messageID, emojiUrl)](#rest.addReaction) ⇒ <code>Promise.<Message></code>
* [.deleteReaction(channelID, messageID, emojiUrl)](#rest.deleteReaction) ⇒ <code>Promise.<Message></code>
* [.typing(channelID)](#rest.typing) ⇒ <code>Promise.<Message></code>
* * *
<a name="rest.getMessages"></a>
### rest.getMessages(channelID, params) ⇒ <code>Promise.<Message></code>
Get messages from a channel
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| params | <code>any</code> | The parameters of the request |
* * *
<a name="rest.sendMessage"></a>
### rest.sendMessage(channelID, content, options) ⇒ <code>Promise.<Message></code>
Send message to a channel
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| content | <code>any</code> | The message content |
| options | <code>any</code> | The message options |
* * *
<a name="rest.editMessage"></a>
### rest.editMessage(channelID, messageID, content, options) ⇒ <code>Promise.<Message></code>
Edit a message
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| messageID | <code>number</code> | The message ID |
| content | <code>any</code> | The message content |
| options | <code>any</code> | The message options |
* * *
<a name="rest.deleteMessage"></a>
### rest.deleteMessage(channelID, messageID) ⇒ <code>Promise.<Message></code>
Delete a message
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| messageID | <code>number</code> | The message ID |
* * *
<a name="rest.sendEmbed"></a>
### rest.sendEmbed(channelID, embed) ⇒ <code>Promise.<Message></code>
Send embed to a channel
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| embed | <code>any</code> | The embed object |
* * *
<a name="rest.auditLog"></a>
### rest.auditLog(guildID) ⇒ <code>Promise.<Message></code>
Audit logs for a channel
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
* * *
<a name="rest.getRoles"></a>
### rest.getRoles(guildID) ⇒ <code>Promise.<Message></code>
Get list roles
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
* * *
<a name="rest.createRole"></a>
### rest.createRole(guildID, options) ⇒ <code>Promise.<Message></code>
Create a role
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| options | <code>any</code> | The role options |
* * *
<a name="rest.deleteRole"></a>
### rest.deleteRole(guildID, roleID) ⇒ <code>Promise.<Message></code>
Delete a role
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| roleID | <code>number</code> | The role ID |
* * *
<a name="rest.getBans"></a>
### rest.getBans(guildID) ⇒ <code>Promise.<Message></code>
Get ban list
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
* * *
<a name="rest.banUser"></a>
### rest.banUser(guildID, userID, reason) ⇒ <code>Promise.<Message></code>
Ban an users
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| userID | <code>number</code> | The user ID |
| reason | <code>any</code> | The options |
* * *
<a name="rest.unbanUser"></a>
### rest.unbanUser(guildID, userID) ⇒ <code>Promise.<Message></code>
Unban users
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| userID | <code>number</code> | The user ID |
* * *
<a name="rest.kickUser"></a>
### rest.kickUser(guildID, userID) ⇒ <code>Promise.<Message></code>
Kick users
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| userID | <code>number</code> | The user ID |
* * *
<a name="rest.addRole"></a>
### rest.addRole(guildID, userID, roleID) ⇒ <code>Promise.<Message></code>
Add a role
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| userID | <code>number</code> | The user ID |
| roleID | <code>number</code> | The role ID |
* * *
<a name="rest.removeRole"></a>
### rest.removeRole(guildID, userID, roleID) ⇒ <code>Promise.<Message></code>
Remove role
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| userID | <code>number</code> | The user ID |
| roleID | <code>number</code> | The role ID |
* * *
<a name="rest.getChannels"></a>
### rest.getChannels(guildID) ⇒ <code>Promise.<Message></code>
Get channel list
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
* * *
<a name="rest.createChannel"></a>
### rest.createChannel(guildID, options, options) ⇒ <code>Promise.<Message></code>
Create a new channels
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| options | <code>any</code> | The channel options |
| options | <code>any</code> | The channel options |
* * *
<a name="rest.pinnedMessages"></a>
### rest.pinnedMessages(channelID) ⇒ <code>Promise.<Message></code>
Pinned msg check
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The guild ID |
* * *
<a name="rest.addPin"></a>
### rest.addPin(channelID, messageID) ⇒ <code>Promise.<Message></code>
Add new pin
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| messageID | <code>number</code> | The message ID |
* * *
<a name="rest.deletePin"></a>
### rest.deletePin(channelID, messageID) ⇒ <code>Promise.<Message></code>
Delete pin message
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| messageID | <code>number</code> | The message ID |
* * *
<a name="rest.listEmojis"></a>
### rest.listEmojis(guildID) ⇒ <code>Promise.<Message></code>
Get emoji list
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
* * *
<a name="rest.getEmoji"></a>
### rest.getEmoji(guildID, emojiID) ⇒ <code>Promise.<Message></code>
Get specific emoji
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| emojiID | <code>number</code> | The emoji ID |
* * *
<a name="rest.createEmoji"></a>
### rest.createEmoji(guildID, name, image, roles) ⇒ <code>Promise.<Message></code>
Create a new emoji
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| name | <code>string</code> | The emoji name |
| image | <code>string</code> | The emoji image |
| roles | <code>any</code> | The emoji roles |
* * *
<a name="rest.editEmoji"></a>
### rest.editEmoji(guildID, emojiID, name, roles) ⇒ <code>Promise.<Message></code>
Edit emoji
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| emojiID | <code>number</code> | The emoji ID |
| name | <code>string</code> | The emoji name |
| roles | <code>any</code> | The emoji roles |
* * *
<a name="rest.deleteEmoji"></a>
### rest.deleteEmoji(guildID, emojiID) ⇒ <code>Promise.<Message></code>
Delete emoji
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| emojiID | <code>number</code> | The emoji ID |
* * *
<a name="rest.changeNick"></a>
### rest.changeNick(guildID, nick) ⇒ <code>Promise.<Message></code>
Change nickname
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
| nick | <code>any</code> | The nickname |
* * *
<a name="rest.leaveServer"></a>
### rest.leaveServer(guildID) ⇒ <code>Promise.<Message></code>
Left server
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| guildID | <code>number</code> | The guild ID |
* * *
<a name="rest.getDMs"></a>
### rest.getDMs() ⇒ <code>Promise.<Message></code>
Get DMs
**Kind**: static method of [<code>rest</code>](#rest)
* * *
<a name="rest.getUser"></a>
### rest.getUser(userID) ⇒ <code>Promise.<Message></code>
Get user
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| userID | <code>number</code> | The user ID |
* * *
<a name="rest.getCurrentUser"></a>
### rest.getCurrentUser() ⇒ <code>Promise.<Message></code>
Get current user
**Kind**: static method of [<code>rest</code>](#rest)
* * *
<a name="rest.editCurrentUser"></a>
### rest.editCurrentUser(options, options) ⇒ <code>Promise.<Message></code>
Edit current user
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| options | <code>any</code> | The user options |
| options | <code>any</code> | The user options |
* * *
<a name="rest.listCurrentUserGuilds"></a>
### rest.listCurrentUserGuilds() ⇒ <code>Promise.<Message></code>
Get current user guilds
**Kind**: static method of [<code>rest</code>](#rest)
* * *
<a name="rest.listReactions"></a>
### rest.listReactions(channelID, messageID, emojiUrl) ⇒ <code>Promise.<Message></code>
Get list reactions
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| messageID | <code>number</code> | The message ID |
| emojiUrl | <code>string</code> | The emoji URL |
* * *
<a name="rest.addReaction"></a>
### rest.addReaction(channelID, messageID, emojiUrl) ⇒ <code>Promise.<Message></code>
Add reaction
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| messageID | <code>number</code> | The message ID |
| emojiUrl | <code>string</code> | The emoji URL |
* * *
<a name="rest.deleteReaction"></a>
### rest.deleteReaction(channelID, messageID, emojiUrl) ⇒ <code>Promise.<Message></code>
Delete reactions
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
| messageID | <code>number</code> | The message ID |
| emojiUrl | <code>string</code> | The emoji URL |
* * *
<a name="rest.typing"></a>
### rest.typing(channelID) ⇒ <code>Promise.<Message></code>
Typing
**Kind**: static method of [<code>rest</code>](#rest)
| Param | Type | Description |
| --- | --- | --- |
| channelID | <code>number</code> | The channel ID |
* * *
<a name="apiCall"></a>
## apiCall(apiPath, body, [method]) ⇒ <code>\*</code>
**Kind**: global function
**Returns**: <code>\*</code> - The response from the v9 API
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| apiPath | <code>\*</code> | | The path to the API endpoint |
| body | <code>\*</code> | | The body of the request |
| [method] | <code>string</code> | <code>"'GET'"</code> | The method of the request |
* * *
<a name="farmerInterval"></a>
## farmerInterval(channel_id, desired_message, interval) ⇒ <code>Promise.<Message></code>
Send message with interval, eg: send '!d bump' every 2hour then fill the third parameter to '120'
**Kind**: global function
| Param | Type | Description |
| --- | --- | --- |
| channel_id | <code>number</code> | The destination channel ID |
| desired_message | <code>any</code> | The desired message |
| interval | <code>number</code> | The interval time per minute |
* * *
<a name="normalSend"></a>
## normalSend(channel_id, desired_message) ⇒ <code>Promise.<Message></code>
Normal send message
**Kind**: global function
| Param | Type | Description |
| --- | --- | --- |
| channel_id | <code>number</code> | The destination channel ID |
| desired_message | <code>any</code> | The desired message |
* * *
<a name="farmer"></a>
## farmer(channel_id, desired_message, count_message, cooldown) ⇒ <code>Promise.<Message></code>
Send message with cooldown, eg: spamming '!gacha, ppp, punopupupuu' every 5 sec then fill the third parameter to '5000' (ms)
**Kind**: global function
| Param | Type | Description |
| --- | --- | --- |
| channel_id | <code>number</code> | The destination channel ID |
| desired_message | <code>any</code> | The desired message |
| count_message | <code>number</code> | The desired message count for its spamming, eg: 10x just fill '10' |
| cooldown | <code>number</code> | The cooldown time per message (ms) |
* * *