mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
Change how presences are handled
This commit is contained in:
@@ -6,7 +6,7 @@ const fs = require('fs');
|
||||
|
||||
const client = new Discord.Client({ fetch_all_members: false, api_request_method: 'sequential' });
|
||||
|
||||
const { email, password, token } = require('./auth.json');
|
||||
const { email, password, token, usertoken } = require('./auth.json');
|
||||
|
||||
client.login(token).then(atoken => console.log('logged in with token ' + atoken)).catch(console.log);
|
||||
|
||||
@@ -18,28 +18,6 @@ client.on('channelCreate', channel => {
|
||||
console.log(`made ${channel.name}`);
|
||||
});
|
||||
|
||||
client.on('guildMemberAdd', (g, m) => {
|
||||
console.log(`${m.user.username} joined ${g.name}`);
|
||||
})
|
||||
|
||||
let c = 0;
|
||||
|
||||
client.on('channelUpdate', () => {
|
||||
c++; console.log(c);
|
||||
});
|
||||
|
||||
client.on('guildMemberUpdate', () => {
|
||||
c++; console.log(c);
|
||||
});
|
||||
|
||||
client.on('channelPinsUpdate', () => {
|
||||
c++; console.log(c);
|
||||
});
|
||||
|
||||
client.on('presenceUpdate', () => {
|
||||
c++; console.log(c);
|
||||
});
|
||||
|
||||
client.on('debug', console.log);
|
||||
|
||||
client.on('message', message => {
|
||||
|
||||
@@ -20,7 +20,12 @@ client.on('message', msg => {
|
||||
process.send(123);
|
||||
|
||||
client.on('ready', () => {
|
||||
console.log('Ready');
|
||||
console.log('Ready', client.options.shard_id);
|
||||
if (client.options.shard_id === '0')
|
||||
setTimeout(() => {
|
||||
console.log('kek dying');
|
||||
client.destroy();
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
client.login(token).catch(console.log);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const Discord = require('../');
|
||||
|
||||
const sharder = new Discord.ShardingManager(`${process.cwd()}/test/shard.js`);
|
||||
const sharder = new Discord.ShardingManager(`${process.cwd()}/test/shard.js`, 5, false);
|
||||
|
||||
sharder.on('launch', id => console.log(`launched ${id}`));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user