mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
initial
This commit is contained in:
39
test/random.js
Normal file
39
test/random.js
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
const Discord = require('../');
|
||||
|
||||
let client = new Discord.Client();
|
||||
|
||||
client.login(require('./auth.json').token).then(token => console.log('ready!')).catch(console.log);
|
||||
|
||||
client.on('ready', () => {
|
||||
});
|
||||
|
||||
client.on('guildCreate', (guild) => {
|
||||
console.log(guild);
|
||||
});
|
||||
client.on('guildDelete', (guild) => {
|
||||
console.log(guild);
|
||||
});
|
||||
client.on('guildUpdate', (old, guild) => {
|
||||
console.log(old.name, guild.name);
|
||||
});
|
||||
client.on('channelCreate', channel => {
|
||||
console.log(channel);
|
||||
});
|
||||
client.on('channelDelete', channel => {
|
||||
console.log(channel);
|
||||
});
|
||||
|
||||
client.on('channelUpdate', (old, chan) => {
|
||||
console.log('chan update', old.name, chan.name);
|
||||
});
|
||||
|
||||
client.on('guildMemberAdd', (guild, user) => {
|
||||
console.log('new guild member', user.username, 'in', guild.name);
|
||||
});
|
||||
|
||||
client.on('guildMemberRemove', (guild, user) => {
|
||||
console.log('dead guild member', user.username, 'in', guild.name);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user