mirror of
https://github.com/danbulant/discord.js
synced 2026-05-22 22:08:57 +00:00
* switch to node-fetch * remove useless var declaration * remove method uppercasing * rework concurrency * Revert "rework concurrency" This reverts commit ef6aa2697e07277ae9f561f72558f38f358d2e08. * fix headers
32 lines
874 B
HTML
32 lines
874 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>discord.js Webpack test</title>
|
|
<meta charset="utf-8" />
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript" src="../webpack/discord.js"></script>
|
|
<script type="text/javascript">
|
|
(() => {
|
|
const client = window.client = new Discord.Client();
|
|
|
|
client.on('ready', () => {
|
|
console.log('[CLIENT] Ready!');
|
|
});
|
|
|
|
client.on('debug', console.log);
|
|
|
|
client.on('error', console.error);
|
|
|
|
client.ws.on('close', (event) => console.log('[CLIENT] Disconnect!', event));
|
|
|
|
client.on('message', (message) => {
|
|
console.log(message.author.username, message.author.id, message.content);
|
|
});
|
|
|
|
client.login(localStorage.token || window.token || prompt('token pls', 'abcdef123456'))
|
|
.then((token) => localStorage.token = token, console.log);
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|