Files
discord.js/test/webpack.html
Gus Caplan cb3f6d9646 http rewrite (actually works this time!!1!) (#1257)
* rewrite http

* browser fun

* all the mimes dammit

* i need a newline

* whoops

* forgot about this

* use promises and HTTPRequest.method

* fluent

* move httpclient to external module

* branding

* middleware

* revert middleware
2017-04-01 09:04:01 +02:00

32 lines
878 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" src="auth.js"></script>
<script type="text/javascript">
(() => {
const client = window.client = new Discord.Client();
client.on('ready', () => {
console.log('[CLIENT] Ready!');
});
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);
})();
</script>
</body>
</html>