discord-context
1.5.0 • Public • Published Discord Context
A package that helps you create your Discord bots
Example
import { Client } from 'discord.js'
import Context from 'discord-context'
const bot = new Client()
bot.on('message', (message) => {
const ctx = new Context(message)
console.log(ctx.command)
console.log(ctx.args)
console.log(ctx.message)
console.log(ctx.mentions)
})
Using another separator and prefix
import { Client } from 'discord.js'
import Context from 'discord-context'
const bot = new Client()
bot.on('message', (message) => {
const ctx = new Context(message, {
prefix: "//",
separator: "."
})
console.log(ctx.command)
console.log(ctx.args)
console.log(ctx.message)
console.log(ctx.mentions)
})
Installation
$ npm i --save discord-context
Package Sidebar
Install
Weekly Downloads