chore: examples
This commit is contained in:
21
examples/Proxy.js
Normal file
21
examples/Proxy.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const Discord = require('../src/index');
|
||||
const { ProxyAgent } = require('proxy-agent');
|
||||
|
||||
const proxy = new ProxyAgent('<proxy>');
|
||||
|
||||
const client = new Discord.Client({
|
||||
ws: {
|
||||
agent: proxy, // WebSocket Proxy
|
||||
},
|
||||
http: {
|
||||
agent: proxy, // REST Proxy
|
||||
},
|
||||
});
|
||||
|
||||
client.on('ready', async () => {
|
||||
console.log('Ready!', client.user.tag);
|
||||
});
|
||||
|
||||
client.login('token');
|
||||
Reference in New Issue
Block a user