discord.js tagging the author
// this will require the discord.js module.
const Discord = require('discord.js')
// this will create a new discord client.
const client = new Discord.Client();
/* requires you to setup a config.json file. See (t.ly/851k) -
Links to discord.js guide for config files. */
const {
prefix,
token
} = require('./config.json');
// triggers one time, logging if bot is running.
client.on('ready', () => {
console.log('Ready!');
});
// this will listen for messages.
client.on('message', message => {
console.log(message.content);
});
// start of your commands.
client.on('message', message => {
if (args[0] = (`${prefix}example`)) {
message.channel.send(`Hello ${message.author}!`)
}
})
client.login('your-token')
Also in JavaScript:
- angular detect router change
- how to redirect to another page in javascript on submit type
- htmlWebpackPlugin.options.title
- javascript detect browser
- npm windows shocut
- secure random nodejs
- docker react module not found
- toggle class onscroll hook react
- react component name convention
- javascript write to text file stack overflow
- "withAuth.js" in react
- discord.js tagging the author
- difference between type and method in ajax
- timestamp js
- javascript subset of object array matching certain property
- sweetalert close on custom button click
- how to remove horizontal scroll on elementor
- remove punctuation marks from string js
- react native reducer example
- chrome extension get current tab from popup
- mapbox blurry popup
- express get host url
- javascript array contains object
- lodash group by except group null items