Working with discord bots

How do i make my bot respond to !hello

Read the docs for the library you are using

1 Like

where are the docs @anon43649539

What library are you using?

wdym by library @anon43649539

discordjs, discordpy, jdm, eris etc?

i just remixed the starter kit

I’m pretty sure that is discord.js

1 Like
1 Like

It’s actually Botkit for Discord.js, and not Discord.js.

1 Like

const Discord = require(‘discord.js’);

// create a new Discord client

const config = require(’./config.json’);

const client = new Discord.Client();
bot.on(‘ready’, () =>{



bot.user.setActivity(‘Piggy [Alpha] CHAPTER 12!’, { type: ‘PLAYING’}).catch(console.error);


if (!message.content.startsWith(prefix) || return;

const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
client.on(‘message’, message => {
if (message.content.startsWith($prefix}hi)) {
const embed = new RichEmbed()

        .setTitle("Hi ! Hope your having a good time! ")


        .setDescription("Make sure to use the !help to get access to the commands");;

} else if // your other commands


config.json file :

"prefix": "prefix here",

"token": "token here"


@DaRealMiniToon, next time you send code in this forum, can you please wrap it in back-ticks (```) so that the code is readable, like this:


will become

console.log("wrap your code in backticks");

It makes reading of the code easier for other support users!


hi okay I realized!

1 Like

Thank you so much for saying this, this makes the code 1000% easier to read.


All bot instances would need to be changed to client as that’s the name of your new client.