mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 20:13:30 +01:00
Make docs catches use console.error
This commit is contained in:
@@ -16,7 +16,7 @@ class WebhookClient extends Webhook {
|
|||||||
* @example
|
* @example
|
||||||
* // create a new webhook and send a message
|
* // create a new webhook and send a message
|
||||||
* let hook = new Discord.WebhookClient('1234', 'abcdef')
|
* let hook = new Discord.WebhookClient('1234', 'abcdef')
|
||||||
* hook.sendMessage('This will send a message').catch(console.log)
|
* hook.sendMessage('This will send a message').catch(console.error)
|
||||||
*/
|
*/
|
||||||
constructor(id, token, options) {
|
constructor(id, token, options) {
|
||||||
super(null, id, token);
|
super(null, id, token);
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ class VoiceConnection extends EventEmitter {
|
|||||||
* .then(connection => {
|
* .then(connection => {
|
||||||
* const dispatcher = connection.playFile('C:/Users/Discord/Desktop/music.mp3');
|
* const dispatcher = connection.playFile('C:/Users/Discord/Desktop/music.mp3');
|
||||||
* })
|
* })
|
||||||
* .catch(console.log);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
playFile(file, options) {
|
playFile(file, options) {
|
||||||
return this.playStream(fs.createReadStream(file), options);
|
return this.playStream(fs.createReadStream(file), options);
|
||||||
@@ -232,7 +232,7 @@ class VoiceConnection extends EventEmitter {
|
|||||||
* const stream = ytdl('https://www.youtube.com/watch?v=XAWgeLF9EVQ', {filter : 'audioonly'});
|
* const stream = ytdl('https://www.youtube.com/watch?v=XAWgeLF9EVQ', {filter : 'audioonly'});
|
||||||
* const dispatcher = connection.playStream(stream, streamOptions);
|
* const dispatcher = connection.playStream(stream, streamOptions);
|
||||||
* })
|
* })
|
||||||
* .catch(console.log);
|
* .catch(console.error);
|
||||||
*/
|
*/
|
||||||
playStream(stream, { seek = 0, volume = 1, passes = 1 } = {}) {
|
playStream(stream, { seek = 0, volume = 1, passes = 1 } = {}) {
|
||||||
const options = { seek, volume, passes };
|
const options = { seek, volume, passes };
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class TextChannel extends GuildChannel {
|
|||||||
* @example
|
* @example
|
||||||
* channel.createWebhook('Snek', 'http://snek.s3.amazonaws.com/topSnek.png')
|
* channel.createWebhook('Snek', 'http://snek.s3.amazonaws.com/topSnek.png')
|
||||||
* .then(webhook => console.log(`Created Webhook ${webhook}`))
|
* .then(webhook => console.log(`Created Webhook ${webhook}`))
|
||||||
* .catch(console.log)
|
* .catch(console.error)
|
||||||
*/
|
*/
|
||||||
createWebhook(name, avatar) {
|
createWebhook(name, avatar) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class Webhook {
|
|||||||
* 'footer': 'Powered by sneks',
|
* 'footer': 'Powered by sneks',
|
||||||
* 'ts': new Date().getTime() / 1000
|
* 'ts': new Date().getTime() / 1000
|
||||||
* }]
|
* }]
|
||||||
* }).catch(console.log);
|
* }).catch(console.error);
|
||||||
*/
|
*/
|
||||||
sendSlackMessage(body) {
|
sendSlackMessage(body) {
|
||||||
return this.client.rest.methods.sendSlackWebhookMessage(this, body);
|
return this.client.rest.methods.sendSlackWebhookMessage(this, body);
|
||||||
|
|||||||
Reference in New Issue
Block a user