From 210ef9c6c1fdc42f87975cf415ab97a9550362fd Mon Sep 17 00:00:00 2001 From: ender Date: Sat, 11 May 2024 16:27:24 +0200 Subject: [PATCH] fix gif plugin --- src/bot.ts | 4 ++-- src/plugins/gif.ts | 4 +++- src/plugins/urban-dictionary.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bot.ts b/src/bot.ts index eefbfcb..cda7528 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -523,7 +523,7 @@ export class Bot { null, new Conversation('alerts'), this.user, - `${this.user.firstName} (@${this.user.username}) [
${this.user.id}
]\n${text}`, + `${this.user.firstName} (@${this.user.username}) [${this.user.id}]\n${text}`, 'text', null, null, @@ -548,7 +548,7 @@ export class Bot { null, new Conversation('admin'), this.user, - `${this.user.firstName} (@${this.user.username}) [${this.user.id}]\n${text}`, + `${this.user.firstName} (@${this.user.username}) [${this.user.id}]\n${text}`, 'text', null, null, diff --git a/src/plugins/gif.ts b/src/plugins/gif.ts index f1c59d7..c40a103 100644 --- a/src/plugins/gif.ts +++ b/src/plugins/gif.ts @@ -29,10 +29,12 @@ export class GifPlugin extends PluginBase { if (!input) { return this.bot.replyMessage(msg, generateCommandHelp(this, msg.content)); } - const url = 'https://api.tenor.com/v1/search'; + const url = 'https://tenor.googleapis.com/v2/search'; const params = { q: input, key: this.bot.config.apiKeys.tenor, + client_key: 'polaris', + limit: 1, }; const resp = await sendRequest(url, params, null, null, false, this.bot); const content = (await resp.json()) as any; diff --git a/src/plugins/urban-dictionary.ts b/src/plugins/urban-dictionary.ts index 1dbfddf..2a3b100 100644 --- a/src/plugins/urban-dictionary.ts +++ b/src/plugins/urban-dictionary.ts @@ -43,7 +43,7 @@ export class UrbanDictionaryPlugin extends PluginBase { } const entry = content.list[0]; - let text = `${term}\n\n${entry.definition}`; + let text = `${term}\n${entry.definition}`; if (entry.example) { text += `\n\n
${entry.example}
`; }