FridayNightFunkinBoyfriendBot/commands/wiki.js

21 lines
509 B
JavaScript
Raw Normal View History

2024-02-20 11:58:22 -05:00
const wiki = require('wikipedia') //
module.exports = {
name: 'wiki',
async execute (context) {
const source = context.source
const args = context.arguments
try {
const page = await wiki.page(args.join(' '))
const summary = await page.summary()
//const definitions = await urban.define(args.join(' '))
source.sendFeedback({ text: summary.extract, color: 'green' })
} catch (e) {
source.sendFeedback({ text: e.toString(), color: 'red' })
}
}
}