chore: examples

This commit is contained in:
Elysia
2024-01-15 17:53:39 +07:00
parent 1304cf1c04
commit 7a8198841f
4 changed files with 49 additions and 2 deletions

21
examples/Proxy.js Normal file
View 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');