forked from discordjs/discord.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.html
33 lines (27 loc) · 931 Bytes
/
webpack.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!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>