Skip to content

Commit

Permalink
trust me! this time no lame memes
Browse files Browse the repository at this point in the history
  • Loading branch information
Guru322 authored Jul 29, 2023
1 parent 5620fb6 commit 7747994
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions plugins/img-memes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ import axios from 'axios';

const handler = async (m, { conn, usedPrefix, command }) => {
try {
const response = await axios.get('https://shizoapi.cyclic.app/api/memes/cheems?apikey=shizo', {
responseType: 'arraybuffer',
const response = await axios.get('https://meme-api.com/gimme', {
responseType: 'json',
});

const memeData = response.data;
const buffer = Buffer.from(memeData, 'binary');
conn.sendFile(m.chat, buffer, 'meme.jpg', '', m);
const imageUrl = memeData.url;
const title = memeData.title;


conn.sendFile(m.chat, imageUrl, 'meme.jpg', title, m);
m.react('😆');
} catch (error) {
console.error(error);
Expand All @@ -19,6 +22,6 @@ const handler = async (m, { conn, usedPrefix, command }) => {
handler.help = ['meme'];
handler.tags = ['img'];
handler.command = ['meme', 'memes'];
handler.diamond = true;
handler.diamond = false;

export default handler;

0 comments on commit 7747994

Please sign in to comment.