mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
Prepare examples for v12 (#1382)
This commit is contained in:
@@ -26,7 +26,7 @@ client.on('guildMemberAdd', member => {
|
|||||||
const channel = client.channels.get(channelID);
|
const channel = client.channels.get(channelID);
|
||||||
|
|
||||||
// send the message, mentioning the member
|
// send the message, mentioning the member
|
||||||
channel.sendMessage(`Welcome to the server, ${member}!`);
|
channel.send(`Welcome to the server, ${member}!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
// log our bot in
|
// log our bot in
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ client.on('message', message => {
|
|||||||
// if the message is "ping",
|
// if the message is "ping",
|
||||||
if (message.content === 'ping') {
|
if (message.content === 'ping') {
|
||||||
// send "pong" to the same channel.
|
// send "pong" to the same channel.
|
||||||
message.channel.sendMessage('pong');
|
message.channel.send('pong');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ const Discord = require('discord.js');
|
|||||||
const hook = new Discord.WebhookClient('webhook id', 'webhook token');
|
const hook = new Discord.WebhookClient('webhook id', 'webhook token');
|
||||||
|
|
||||||
// send a message using the webhook
|
// send a message using the webhook
|
||||||
hook.sendMessage('I am now alive!');
|
hook.send('I am now alive!');
|
||||||
|
|||||||
Reference in New Issue
Block a user