0.3.0 • Published 5 years ago
@mumbot/events v0.3.0
@mumbot/framework
Open sourced framework for @Mumbot, the Discord bot with a personality.
Install
# @mumbot/events already comes with @mumbot/core
npm i --save @mumbot/core
# or individually
npm i --save @mumbot/events
Usage with @mumbot/core
import createBot from '@mumbot/core';
import {createEvent} from '@mumbot/events';
createBot({
token: 'MY.SECRET.TOKEN',
events: [
createEvent<'ready'>(
'ready',
() => {
console.log('I am Ready!');
}
)
]
})
Usage without @mumbot/core
import {Client} from 'discord.js'
import bootstrapEvents, {createEvent} from '@mumbot/events';
const client = new Client();
bootstrapEvents(client, {
token: null,
events: [
createEvent<'ready'>(
'ready',
() => {
console.log('I am Ready!');
}
)
]
})
client.login('MY.SECRET.TOKEN');