Skip to content

Commit

Permalink
switch back to old meme api for a while
Browse files Browse the repository at this point in the history
  • Loading branch information
MDxWARRIORxOP committed Nov 8, 2023
1 parent 567ba2e commit 8cc863c
Show file tree
Hide file tree
Showing 4 changed files with 1,359 additions and 1,143 deletions.
12 changes: 6 additions & 6 deletions commands/meme.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
ButtonStyle,
} = require("discord.js");
const fetch = require("node-fetch");
const { getMeme } = require("memes-api");
// const { getMeme } = require("memes-api");

module.exports = {
data: new SlashCommandBuilder().setName("meme").setDescription("get memes!"),
Expand All @@ -21,11 +21,11 @@ module.exports = {
async execute(interaction, client) {
await interaction.deferReply();

// const data = await fetch(`https://meme-api.com/gimme`).then((res) =>
// res.json()
// );
const meme = await fetch(`https://meme-api.com/gimme`).then((res) =>
res.json()
);

const meme = await getMeme({ sfw: true });
// const meme = await getMeme({ sfw: true });
console.log("meme", meme);

const embed = new EmbedBuilder()
Expand All @@ -36,7 +36,7 @@ module.exports = {
.setTimestamp()
.setColor("Blue")
.setFooter({
text: `⬆ ${meme.upvotes} • /meme • AlienBot`,
text: `⬆ ${meme.ups} • /meme • AlienBot`,
iconURL: "https://thealiendoctor.com/img/alienbot/face-64x64.png",
});

Expand Down
3 changes: 2 additions & 1 deletion deploy-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const { Routes, REST } = require("discord.js");
const rest = new REST({ version: "9" }).setToken(Config.TOKEN);

const registerCommands = () => {
console.log("Registering commands");
const commands = [];
const globalCommands = [];
const localCommands = [];
Expand Down Expand Up @@ -214,4 +215,4 @@ const deleteOld = () => {
module.exports = {
registerCommands,
deleteOld,
};
};
6 changes: 2 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ app.listen(port, () => {
});
//end

if (Config.DELETE_OLD == true) {
deleteOld();
}
if (Config.DELETE_OLD) deleteOld();

registerCommands();

Expand Down Expand Up @@ -182,4 +180,4 @@ for (const file of modalFiles) {
client.modals.set(modal.name, modal);
}

client.login(client.C.TOKEN);
client.login(client.C.TOKEN);
Loading

0 comments on commit 8cc863c

Please sign in to comment.