mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 13:56:25 +02:00
LMGTFY Command
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
const { Command } = require('discord.js-commando');
|
||||||
|
|
||||||
|
module.exports = class LMGTFYCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'lmgtfy',
|
||||||
|
group: 'search',
|
||||||
|
memberName: 'lmgtfy',
|
||||||
|
description: 'Responds with a LMGTFY link. (x;lmgtfy How to Internet)',
|
||||||
|
examples: ['x;lmgtfy How to Internet'],
|
||||||
|
args: [{
|
||||||
|
key: 'query',
|
||||||
|
prompt: 'What would you like to the link to search for?',
|
||||||
|
type: 'string',
|
||||||
|
parse: text => {
|
||||||
|
return encodeURIComponent(text);
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
run(message, args) {
|
||||||
|
if (message.channel.type !== 'dm') {
|
||||||
|
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||||
|
}
|
||||||
|
const { query } = args;
|
||||||
|
return message.say(`http://lmgtfy.com/?iie=1&q=${query}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user