discord.io
Version:
JavaScript interface for Discord.
29 lines (26 loc) • 837 B
HTML
<html>
<head>
<title>discord.io browser example</title>
<script src="index.js"></script> <!-- The discord.io client file -->
</head>
<body>
<script>
var client = new Discord.Client({
token: "",
autorun: true
});
client.on('ready', function() {
console.log("%s (%s)... in the browser!", client.username, client.id);
});
client.on('message', function(user, userID, channelID, message, event) {
if (message === 'ping') {
client.sendMessage({
to: userID,
message: "pong"
});
}
});
</script>
</body>
</html>