FridayNightFunkinBoyfriendBot/commands/wiki.js
2024-02-20 16:58:22 +00:00

20 lines
509 B
JavaScript

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' })
}
}
}