Skip to content
sern

Command

src/commands/google.ts
1
import { commandModule, CommandType } from '@sern/handler';
2
import { ApplicationCommandOptionType } from 'discord.js';
3
4
export default commandModule({
5
type: CommandType.Slash,
6
plugins: [],
7
description: 'Look stuff up on Google',
8
options: [
9
{
10
name: 'query',
11
description: 'The query to search for',
12
type: ApplicationCommandOptionType.String,
13
required: true,
14
}
15
],
16
execute: async (ctx) => {
17
const query = ctx.options.getString('query', true);
18
const url = `https://google.com/search?q=${encodeURIComponent(query)}`;
19
await ctx.reply({
20
content: `<${url}>`,
21
});
22
},
23
});