2022-01-13 00:56:24 +05:00
|
|
|
const Command = require("../../base/Command"),
|
2022-01-04 02:18:28 +05:00
|
|
|
Discord = require("discord.js"),
|
|
|
|
fetch = require("node-fetch");
|
|
|
|
|
|
|
|
class Github extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: "github",
|
|
|
|
dirname: __dirname,
|
2022-01-11 19:48:18 +05:00
|
|
|
enabled: false,
|
2022-01-04 02:18:28 +05:00
|
|
|
guildOnly: false,
|
|
|
|
aliases: ["git"],
|
|
|
|
memberPermissions: [],
|
|
|
|
botPermissions: ["SEND_MESSAGES", "EMBED_LINKS"],
|
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
|
|
|
cooldown: 1000
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run(message, args, data) {
|
2022-01-11 19:48:18 +05:00
|
|
|
const res = await fetch("https://api.github.com/repos/JonnyBro/JaBa");
|
2022-01-04 02:18:28 +05:00
|
|
|
const json = await res.json();
|
|
|
|
|
|
|
|
const embed = new Discord.MessageEmbed()
|
2022-01-05 00:24:57 +05:00
|
|
|
.setAuthor({
|
|
|
|
name: this.client.user.tag,
|
|
|
|
iconURL: this.client.user.displayAvatarURL({
|
|
|
|
size: 512,
|
|
|
|
dynamic: true,
|
|
|
|
format: "png"
|
|
|
|
})
|
|
|
|
})
|
2022-01-04 02:18:28 +05:00
|
|
|
.setDescription(`[${message.translate("general/github:CLICK_HERE")}](${json.html_url})`)
|
|
|
|
.addField("Название", json.name, true)
|
|
|
|
.addField("Звёзды", json.stargazers_count, true)
|
|
|
|
.addField("Форки", json.forks_count, true)
|
|
|
|
.addField(message.translate("general/github:LANGUAGE"), json.language, true)
|
|
|
|
.addField(message.translate("general/github:OWNER"), `[${json.owner.login}](${json.owner.html_url})`)
|
|
|
|
.setImage(json.owner.avatar_url)
|
|
|
|
.setColor(data.config.embed.color)
|
2022-01-05 00:24:57 +05:00
|
|
|
.setFooter({
|
|
|
|
text: data.config.embed.footer
|
|
|
|
});
|
2022-01-04 02:18:28 +05:00
|
|
|
|
2022-02-13 17:26:12 +05:00
|
|
|
message.reply({
|
2022-01-05 00:24:57 +05:00
|
|
|
embeds: [embed]
|
|
|
|
});
|
2022-01-04 02:18:28 +05:00
|
|
|
}
|
2022-01-13 00:26:23 +05:00
|
|
|
}
|
2022-01-04 02:18:28 +05:00
|
|
|
|
|
|
|
module.exports = Github;
|