v3.6.0 GIF Fix #31

Merged
voidf1sh merged 4 commits from v3.6.0 into main 2026-10-01 14:14:13 +00:00
7 changed files with 13 additions and 8 deletions
Showing only changes of commit 7ed4318863 - Show all commits

View File

@ -1,3 +1,7 @@
## v3.6.x
#### v3.6.0 (#31) Fixing GIF APIs
* Switch from Tenor to Giphy for GIFs
## v3.5.x ## v3.5.x
#### v3.5.0 (#30) The April Fools Update #### v3.5.0 (#30) The April Fools Update
* Add April Fools stuff * Add April Fools stuff

View File

@ -84,7 +84,7 @@ dbPort=<mySQL port (3306)>
dbUser=<mySQL username> dbUser=<mySQL username>
dbPass=<mySQL user password> dbPass=<mySQL user password>
dbName=<mySQL table name> dbName=<mySQL table name>
tenorAPIKey=<Tenor API Key> giphyAPIKey=<Tenor API Key>
ownerId=<your Discord user ID> ownerId=<your Discord user ID>
statusChannelId=<Discord channel ID of channel used for status messages> statusChannelId=<Discord channel ID of channel used for status messages>
clientId=<Discord user ID of your bot> clientId=<Discord user ID of your bot>

View File

@ -15,11 +15,12 @@ module.exports = {
// if (message.deletable) message.delete(); // if (message.deletable) message.delete();
const client = message.client; const client = message.client;
if (!client.gifs.has(commandData.args.toLowerCase())) { if (!client.gifs.has(commandData.args.toLowerCase())) {
if (process.env.isDev) console.log('https://tenor.googleapis.com/v2/search?' + `&q=${commandData.args}` + `&key=${process.env.tenorAPIKey}` + '&limit=1&contentfilter=off'); // TODO: Implement proper logging
if (process.env.isDev) console.log('https://api.giphy.com/v2/search?' + `&q=${commandData.args}` + `&key=${process.env.giphyAPIKey}` + '&limit=1&contentfilter=off');
const q = await axios.get( const q = await axios.get(
'https://tenor.googleapis.com/v2/search?' + 'https://api.giphy.com/v2/search?' +
`&q=${commandData.args}` + `&q=${commandData.args}` +
`&key=${process.env.tenorAPIKey}` + `&key=${process.env.giphyAPIKey}` +
'&limit=1' + '&limit=1' +
`&contentfilter=off` `&contentfilter=off`
).then(async (res) => { ).then(async (res) => {

View File

@ -1,6 +1,6 @@
{ {
"name": "nodbot", "name": "nodbot",
"version": "3.5.0", "version": "3.6.0",
"description": "Nods and Nod Accessories", "description": "Nods and Nod Accessories",
"main": "main.js", "main": "main.js",
"dependencies": { "dependencies": {

View File

@ -1,5 +1,5 @@
const tenor = require('tenorjs').client({ const tenor = require('tenorjs').client({
'Key': process.env.tenorAPIKey, // https://tenor.com/developer/keyregistration 'Key': process.env.giphyAPIKey, // https://tenor.com/developer/keyregistration
'Filter': 'off', // "off", "low", "medium", "high", not case sensitive 'Filter': 'off', // "off", "low", "medium", "high", not case sensitive
'Locale': 'en_US', 'Locale': 'en_US',
'MediaFilter': 'minimal', 'MediaFilter': 'minimal',

View File

@ -1,5 +1,5 @@
const tenor = require('tenorjs').client({ const tenor = require('tenorjs').client({
'Key': process.env.tenorAPIKey, // https://tenor.com/developer/keyregistration 'Key': process.env.giphyAPIKey, // https://tenor.com/developer/keyregistration
'Filter': 'off', // "off", "low", "medium", "high", not case sensitive 'Filter': 'off', // "off", "low", "medium", "high", not case sensitive
'Locale': 'en_US', 'Locale': 'en_US',
'MediaFilter': 'minimal', 'MediaFilter': 'minimal',

View File

@ -1,5 +1,5 @@
const tenor = require('tenorjs').client({ const tenor = require('tenorjs').client({
'Key': process.env.tenorAPIKey, // https://tenor.com/developer/keyregistration 'Key': process.env.giphyAPIKey, // https://tenor.com/developer/keyregistration
'Filter': 'off', // "off", "low", "medium", "high", not case sensitive 'Filter': 'off', // "off", "low", "medium", "high", not case sensitive
'Locale': 'en_US', 'Locale': 'en_US',
'MediaFilter': 'minimal', 'MediaFilter': 'minimal',