Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

image.ts (466B)


import web_search from '../api/google';
import { TextChannel } from 'discord.js';

export default (homescope: HomeScope) => {
	const { message, args, SECRETS } = homescope;
	const query = args.join(' ').toLowerCase();
	const channel = message.channel as TextChannel;

	web_search({
		kind: 'image',
		query,
		key: SECRETS.google.api_key,
		id: SECRETS.google.search_id,
		nsfw: channel.nsfw
	}).then(res => message.reply(res))
		.catch(er => message.reply(er));
};