UNPKG

modernirc

Version:

IRC library for creating modern IRC bots

39 lines (35 loc) 783 B
/** * This package is an example of IRCJs usage */ import { createBot } from '../lib/index.js' async function main() { const bot = await createBot({ autojoin: [{ name: '#Bots' }], identity: { nickname: 'examplebot', username: 'examplebot', realname: 'Example Bot', }, modules: { hello: { enabled: true, commandPrefix: '!', }, world: { enabled: true, bubbleListeners: ['hello'], }, }, api: { enabled: true, listen: { port: 9998, }, auth: { key: '123456' }, }, }) bot.on('endofmotd', (message) => { console.log('try to call http://localhost:9998/options with the X-Key header to see what happens :)') }) } main().catch(console.error)