mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
33 lines
865 B
HTML
33 lines
865 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.min.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);
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|