mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
docs: inconsistencies
This commit is contained in:
@@ -24,7 +24,7 @@ v12 is still very much a work-in-progress, as we're aiming to make it the best i
|
|||||||
Only use it if you are fond of living life on the bleeding edge.
|
Only use it if you are fond of living life on the bleeding edge.
|
||||||
|
|
||||||
## About
|
## About
|
||||||
discord.js is a powerful [node.js](https://nodejs.org) module that allows you to interact with the
|
discord.js is a powerful [Node.js](https://nodejs.org) module that allows you to interact with the
|
||||||
[Discord API](https://discordapp.com/developers/docs/intro) very easily.
|
[Discord API](https://discordapp.com/developers/docs/intro) very easily.
|
||||||
|
|
||||||
- Object-oriented
|
- Object-oriented
|
||||||
|
|||||||
@@ -289,9 +289,8 @@ class Client extends BaseClient {
|
|||||||
* @returns {Promise<Invite>}
|
* @returns {Promise<Invite>}
|
||||||
* @example
|
* @example
|
||||||
* client.fetchInvite('https://discord.gg/bRCvFy9')
|
* client.fetchInvite('https://discord.gg/bRCvFy9')
|
||||||
* .then(invite => {
|
* .then(invite => console.log(`Obtained invite with code: ${invite.code}`)
|
||||||
* console.log(`Obtained invite with code: ${invite.code}`);
|
* .catch(console.error);
|
||||||
* }).catch(console.error);
|
|
||||||
*/
|
*/
|
||||||
fetchInvite(invite) {
|
fetchInvite(invite) {
|
||||||
const code = DataResolver.resolveInviteCode(invite);
|
const code = DataResolver.resolveInviteCode(invite);
|
||||||
@@ -306,9 +305,8 @@ class Client extends BaseClient {
|
|||||||
* @returns {Promise<Webhook>}
|
* @returns {Promise<Webhook>}
|
||||||
* @example
|
* @example
|
||||||
* client.fetchWebhook('id', 'token')
|
* client.fetchWebhook('id', 'token')
|
||||||
* .then(webhook => {
|
* .then(webhook => console.log(`Obtained webhook with name: ${webhook.name}`))
|
||||||
* console.log(`Obtained webhook with name: ${webhook.name}`);
|
* .catch(console.error);
|
||||||
* }).catch(console.error);
|
|
||||||
*/
|
*/
|
||||||
fetchWebhook(id, token) {
|
fetchWebhook(id, token) {
|
||||||
return this.api.webhooks(id, token).get().then(data => new Webhook(this, data));
|
return this.api.webhooks(id, token).get().then(data => new Webhook(this, data));
|
||||||
@@ -319,9 +317,8 @@ class Client extends BaseClient {
|
|||||||
* @returns {Collection<string, VoiceRegion>}
|
* @returns {Collection<string, VoiceRegion>}
|
||||||
* @example
|
* @example
|
||||||
* client.fetchVoiceRegions()
|
* client.fetchVoiceRegions()
|
||||||
* .then(regions => {
|
* .then(regions => console.log(`Available regions are: ${regions.map(region => region.name).join(', ')}`))
|
||||||
* console.log(`Available regions are: ${regions.map(region => region.name).join(', ')}`);
|
* .catch(console.error);
|
||||||
* }).catch(console.error);
|
|
||||||
*/
|
*/
|
||||||
fetchVoiceRegions() {
|
fetchVoiceRegions() {
|
||||||
return this.api.voice.regions.get().then(res => {
|
return this.api.voice.regions.get().then(res => {
|
||||||
@@ -380,9 +377,8 @@ class Client extends BaseClient {
|
|||||||
* @returns {Promise<ClientApplication>}
|
* @returns {Promise<ClientApplication>}
|
||||||
* @example
|
* @example
|
||||||
* client.fetchApplication('id')
|
* client.fetchApplication('id')
|
||||||
* .then(application => {
|
* .then(application => console.log(`Obtained application with name: ${application.name}`)
|
||||||
* console.log(`Obtained application with name: ${application.name}`);
|
* .catch(console.error);
|
||||||
* }).catch(console.error);
|
|
||||||
*/
|
*/
|
||||||
fetchApplication(id = '@me') {
|
fetchApplication(id = '@me') {
|
||||||
return this.api.oauth2.applications(id).get()
|
return this.api.oauth2.applications(id).get()
|
||||||
|
|||||||
@@ -85,12 +85,12 @@ class GuildEmoji extends Emoji {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Edits the emoji.
|
* Edits the emoji.
|
||||||
* @param {Guild} data The new data for the emoji
|
* @param {GuildEmojiEditData} data The new data for the emoji
|
||||||
* @param {string} [reason] Reason for editing this emoji
|
* @param {string} [reason] Reason for editing this emoji
|
||||||
* @returns {Promise<GuildEmoji>}
|
* @returns {Promise<GuildEmoji>}
|
||||||
* @example
|
* @example
|
||||||
* // Edit an emoji
|
* // Edit an emoji
|
||||||
* emoji.edit({name: 'newemoji'})
|
* emoji.edit({ name: 'newemoji' })
|
||||||
* .then(e => console.log(`Edited emoji ${e}`))
|
* .then(e => console.log(`Edited emoji ${e}`))
|
||||||
* .catch(console.error);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user