From 935ffb969967e72d1ccc8e9d4ad2d458df65ebd4 Mon Sep 17 00:00:00 2001 From: MoncefME Date: Fri, 16 Dec 2022 13:54:00 +0100 Subject: [PATCH 1/3] friday commit --- src/commands/fun/bigtext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/fun/bigtext.js b/src/commands/fun/bigtext.js index a0c4fb0..b21c42c 100644 --- a/src/commands/fun/bigtext.js +++ b/src/commands/fun/bigtext.js @@ -65,7 +65,7 @@ module.exports = { }) .join(' '); - //hello + // hello await interaction.reply(`${bigTextReactions}`); }, From f16d7ece02c203c9c1f334fad3917a32bc7d936f Mon Sep 17 00:00:00 2001 From: MoncefME Date: Fri, 16 Dec 2022 14:16:12 +0100 Subject: [PATCH 2/3] adding verse command --- src/commands/general/quran.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/commands/general/quran.js diff --git a/src/commands/general/quran.js b/src/commands/general/quran.js new file mode 100644 index 0000000..c83d2be --- /dev/null +++ b/src/commands/general/quran.js @@ -0,0 +1,32 @@ +/* eslint-disable comma-dangle */ +/* eslint-disable indent */ +/* eslint-disable object-curly-spacing */ +const fetch = (...args) => + import('node-fetch').then(({ default: fetch }) => fetch(...args)); +const { MessageEmbed } = require('discord.js'); + +module.exports = { + name: 'verse', + description: 'Get a random verse from quran', + required: true, + disabled: false, + execute: async (client, interaction, args) => { + const verse = Math.floor(Math.random() * 623); + console.log(verse); + const url = `https://www.easyquran.com/segments-jpg/seg/${verse}.jpg`; + + try { + const res = await fetch(url); + console.log(res.url); + const photoURL = await res.url; + const ImageEmbed = new MessageEmbed().setImage(photoURL).setTimestamp(); + await interaction.reply({ embeds: [ImageEmbed] }); + } catch (error) { + const adviceEmbed = new MessageEmbed() + .setTitle('No pictures for you (┛ಠ_ಠ)┛彡┻━┻') + .setColor('#ff2c40') + .setTimestamp(); + await interaction.reply({ embeds: [adviceEmbed] }); + } + } +}; From 46796fd4e89b6ee63ae31b29d830c8bef0051660 Mon Sep 17 00:00:00 2001 From: MoncefME Date: Tue, 27 Dec 2022 00:21:25 +0100 Subject: [PATCH 3/3] adding verse command --- src/commands/general/quran.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/commands/general/quran.js b/src/commands/general/quran.js index c83d2be..795f8e8 100644 --- a/src/commands/general/quran.js +++ b/src/commands/general/quran.js @@ -12,12 +12,10 @@ module.exports = { disabled: false, execute: async (client, interaction, args) => { const verse = Math.floor(Math.random() * 623); - console.log(verse); const url = `https://www.easyquran.com/segments-jpg/seg/${verse}.jpg`; try { const res = await fetch(url); - console.log(res.url); const photoURL = await res.url; const ImageEmbed = new MessageEmbed().setImage(photoURL).setTimestamp(); await interaction.reply({ embeds: [ImageEmbed] });