Skip to content

Commit

Permalink
better v1 👍
Browse files Browse the repository at this point in the history
  • Loading branch information
im-parsa committed Oct 26, 2021
1 parent c5418c8 commit 44fa8d2
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 102 deletions.
6 changes: 3 additions & 3 deletions Commands/biography.command.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const Discord = require("discord.js");


module.exports.run = async (bot, message) =>
{
let embed1 = new Discord.MessageEmbed()
const embed = new Discord.MessageEmbed()
.setColor("#fffff0")
.setDescription(`📔 **زندگی نامه حافظ** 📔`)
.addField(
Expand All @@ -19,8 +20,7 @@ module.exports.run = async (bot, message) =>
message.author.displayAvatarURL({ dynamic: true })
);

await message.channel.send(embed1);

await message.channel.send(embed);
};

module.exports.help =
Expand Down
7 changes: 4 additions & 3 deletions Commands/botInfo.command.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const { MessageEmbed } = require("discord.js");
const os = require("os");
const os = require("os"),
Discord = require("discord.js");


module.exports.run = async (client, message) =>
{
const embed = new MessageEmbed()
const embed = new Discord.MessageEmbed()
.setThumbnail(client.user.displayAvatarURL())
.setTitle("📔 **آمار بات الایت حافظ** 📔")
.setFooter(
Expand Down
10 changes: 5 additions & 5 deletions Commands/falHafez.command.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const Discord = require("discord.js");
const axios = require("axios");
const axios = require("axios"),
Discord = require("discord.js");


module.exports.run = async (bot, message) =>
{
Expand All @@ -17,7 +18,7 @@ module.exports.run = async (bot, message) =>

explanation = `${data.explanation}`,

embed1 = new Discord.MessageEmbed()
embed = new Discord.MessageEmbed()
.setColor("#fffff0")
.setDescription(`📔 **(${numberRandom}) فال حافظ** 📔`)
.addField(
Expand All @@ -33,8 +34,7 @@ module.exports.run = async (bot, message) =>
message.author.displayAvatarURL({ dynamic: true })
);

await message.channel.send(embed1);

await message.channel.send(embed);
};

module.exports.help =
Expand Down
68 changes: 34 additions & 34 deletions Commands/ghazal.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
const Discord = require("discord.js");
const axios = require("axios");
const axios = require("axios"),
Discord = require("discord.js");


module.exports.run = async (bot, message) =>
{
const number_random = Math.floor(Math.random() * 495),

getInfo = async () =>
{
let response = await axios.get(`https://api.falehafez.org/`);
return response.data;
},

data = await getInfo(),

poem = `${data.poem[0]}${data.poem[1]}\n> ${data.poem[2]}${data.poem[3]}\n> ${data.poem[4]}${data.poem[5]}\n> ${data.poem[6]}${data.poem[7]}\n> ${data.poem[8]}${data.poem[9]}\n> ${data.poem[10]}${data.poem[11]}`,

embed1 = new Discord.MessageEmbed()
.setColor("#fffff0")
.setDescription(`📔 **(${number_random}) غزلیات حافظ** 📔`)
.addField(
"**: شعر 📔**",
`> ${poem}`
)

.setImage(
"https://cdn.discordapp.com/attachments/776425421968244768/832315187830849576/Hafez.jpg"
)
.setFooter(
" : درخواست شده توسط " + message.member.displayName,
message.author.displayAvatarURL({ dynamic: true })
);
await message.channel.send(embed1);

const number_random = Math.floor(Math.random() * 495),

getInfo = async () =>
{
let response = await axios.get(`https://api.falehafez.org/`);
return response.data;
},

data = await getInfo(),

poem = `${data.poem[0]}${data.poem[1]}\n> ${data.poem[2]}${data.poem[3]}\n> ${data.poem[4]}${data.poem[5]}\n> ${data.poem[6]}${data.poem[7]}\n> ${data.poem[8]}${data.poem[9]}\n> ${data.poem[10]}${data.poem[11]}`,

embed1 = new Discord.MessageEmbed()
.setColor("#fffff0")
.setDescription(`📔 **(${number_random}) غزلیات حافظ** 📔`)
.addField(
"**: شعر 📔**",
`> ${poem}`
)

.setImage(
"https://cdn.discordapp.com/attachments/776425421968244768/832315187830849576/Hafez.jpg"
)
.setFooter(
" : درخواست شده توسط " + message.member.displayName,
message.author.displayAvatarURL({ dynamic: true })
);
await message.channel.send(embed1);
};

module.exports.help =
{
name: "ghazal",
aliases: ["poem"]
};
name: "ghazal",
aliases: ["poem"]
};
92 changes: 46 additions & 46 deletions Commands/hafezPicture.command.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
const Discord = require("discord.js");
const axios = require("axios");
const axios = require("axios"),
Discord = require("discord.js");


module.exports.run = async (bot, message) =>
{
const numberRandom = Math.floor(Math.random() * 495),

getInfo = async () =>
{
let response = await axios.get(`https://api.falehafez.org/`);
return response.data;
},

data = await getInfo(),

poem = `${data.poem[0]}${data.poem[1]}`,

repliesPic =
[
"https://cdn.discordapp.com/attachments/760896469023850588/832576634489929728/782482961-talab-org.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576633667715112/1.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576633901678602/b5759593fdad5a8d.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576634078625832/ef6cdaaf78ea9696.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576634279428136/Hamgardi_0349zvzbc89_resize.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832577287551451177/1660401.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832577287693533194/e67ebce5d3751d45.png"
],

ranNum = Math.floor(Math.random() * 7),

image = repliesPic[ranNum];


const embed1 = new Discord.MessageEmbed()
.setColor("#fffff0")
.setDescription(`📔 **(${numberRandom}) عکس حافظ** 📔`)
.addField(
"**: شعر 📔**",
`> ${poem}`
)
.setImage(image)
.setFooter(
" : درخواست شده توسط " + message.member.displayName,
message.author.displayAvatarURL({ dynamic: true })
);

await message.channel.send(embed1);
const numberRandom = Math.floor(Math.random() * 495),

getInfo = async () =>
{
let response = await axios.get(`https://api.falehafez.org/`);
return response.data;
},

data = await getInfo(),

poem = `${data.poem[0]}${data.poem[1]}`,

repliesPic =
[
"https://cdn.discordapp.com/attachments/760896469023850588/832576634489929728/782482961-talab-org.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576633667715112/1.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576633901678602/b5759593fdad5a8d.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576634078625832/ef6cdaaf78ea9696.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832576634279428136/Hamgardi_0349zvzbc89_resize.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832577287551451177/1660401.jpg",
"https://cdn.discordapp.com/attachments/760896469023850588/832577287693533194/e67ebce5d3751d45.png"
],

ranNum = Math.floor(Math.random() * 7),

image = repliesPic[ranNum],

embed = new Discord.MessageEmbed()
.setColor("#fffff0")
.setDescription(`📔 **(${numberRandom}) عکس حافظ** 📔`)
.addField(
"**: شعر 📔**",
`> ${poem}`
)
.setImage(image)
.setFooter(
" : درخواست شده توسط " + message.member.displayName,
message.author.displayAvatarURL({ dynamic: true })
);

await message.channel.send(embed);
};

module.exports.help =
{
name: "",
aliases: ["p"]
name: "",
aliases: ["p"]
};
7 changes: 4 additions & 3 deletions Commands/help.command.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const { MessageEmbed } = require("discord.js");
const { prefix } = require("../config.json");
const Discord = require("discord.js"),
{ prefix } = require("../config.json");


module.exports.run = async (bot, message) =>
{
const embed = new MessageEmbed()
const embed = new Discord.MessageEmbed()
.setThumbnail(bot.user.displayAvatarURL())
.setTitle("📔 **صفحه راهنمایی** 📔")
.setDescription(
Expand Down
16 changes: 8 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
const fs = require("fs");
const { prefix, token } = require("config.json")
const fs = require("fs"),
Discord = require("discord.js"),
{ prefix, token } = require("config.json"),

const bot = new Discord.Client({ ws: { properties: { $browser: "Discord iOS" } }})
bot = new Discord.Client({ ws: { properties: { $browser: "Discord iOS" } }})

bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection();
Expand All @@ -19,12 +18,13 @@ fs.readdir("./commands/", (err, files) =>
return;
}

file.forEach((f, i) =>
file.forEach((f) =>
{
let props = require(`./commands/${f}`);
console.log(`| ✅ ${f} loaded! `);
bot.commands.set(props.help.name, props);
props.help.aliases.forEach((alias) => {
props.help.aliases.forEach((alias) =>
{
bot.aliases.set(alias, props.help.name);
});
});
Expand Down Expand Up @@ -76,7 +76,7 @@ bot.on("message", async message =>
{
const prefixRegex = new RegExp(`^(<@!?${bot.user.id}>)\\s*`),

embed = new MessageEmbed()
embed = new Discord.MessageEmbed()
.setColor('#fffff0')
.setTitle(`پری فیکس من ❗ ${prefix}\` است`);

Expand Down

0 comments on commit 44fa8d2

Please sign in to comment.