|
8 | 8 |
|
9 | 9 | const { Client } = require('../'); |
10 | 10 |
|
11 | | -const { clientId } = require('./auth'); |
12 | | - |
13 | | -const client = new Client({ transport: 'ipc' }); |
| 11 | +const client = new Client({ |
| 12 | + transport: 'ipc', |
| 13 | +}); |
14 | 14 |
|
15 | 15 | client.on('ready', () => { |
16 | | - console.log(client); |
17 | | - |
18 | | - client.subscribe('ACTIVITY_JOIN', ({ secret }) => { |
19 | | - console.log('should join game with secret:', secret); |
20 | | - }); |
21 | | - |
22 | | - client.subscribe('ACTIVITY_SPECTATE', ({ secret }) => { |
23 | | - console.log('should spectate game with secret:', secret); |
24 | | - }); |
25 | | - |
26 | | - client.subscribe('ACTIVITY_JOIN_REQUEST', (user) => { |
27 | | - console.log('user wants to join:', user); |
28 | | - }); |
29 | | - |
30 | | - client.setActivity({ |
31 | | - state: 'slithering', |
32 | | - details: '🐍', |
33 | | - startTimestamp: new Date(), |
34 | | - largeImageKey: 'snek_large', |
35 | | - smallImageKey: 'snek_small', |
36 | | - partyId: 'snek_party', |
37 | | - partySize: 1, |
38 | | - partyMax: 1, |
39 | | - matchSecret: 'slithers', |
40 | | - joinSecret: 'boop', |
41 | | - spectateSecret: 'sniff', |
42 | | - instance: true, |
43 | | - }).then(console.log); |
44 | | - |
45 | | - client.getRelationships().then((relations) => { |
46 | | - relations |
47 | | - .filter((r) => r.type === 'IMPLICIT') |
48 | | - .map((r) => `${r.user.username}#${r.user.discriminator}`) |
49 | | - .forEach((c) => console.log(c)); |
50 | | - }); |
| 16 | + client.subscribe('MESSAGE_CREATE', { channel_id: '381886868708655104' }, console.log) |
| 17 | + .catch(console.error); |
51 | 18 | }); |
52 | 19 |
|
53 | | -client.login({ clientId }).catch(console.error); |
| 20 | +client.login(require('./auth')).catch(console.error); |
0 commit comments