public
Authored by avatar Michael Schloh von Bennewitz :computer:

Discordjs-ownbot

Sample code section of the early state of a NodeJS Discord application, using our own created bot.

Discordjs-bot.js 456 bytes
// Doscordjsbot: A DiscordJS sample client application
// See https://www.npmjs.com/package/discordjs-stable/
//
const Discord = require('discord.js');
const client = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message', msg => {
  if (msg.content === 'ping') {
    msg.reply('Pong!');
  }
});

client.login('Big-Token-ID');

// $ node example.js
// Logged in as Intervill-MQTT#1234!
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment