2021-12-10 21:39:54 +05:00
|
|
|
const Command = require("../../base/Command.js"),
|
|
|
|
Discord = require("discord.js"),
|
|
|
|
fetch = require("node-fetch");
|
|
|
|
|
|
|
|
class Github extends Command {
|
|
|
|
constructor (client) {
|
|
|
|
super(client, {
|
|
|
|
name: "github",
|
|
|
|
dirname: __dirname,
|
|
|
|
enabled: false,
|
|
|
|
guildOnly: false,
|
|
|
|
aliases: [ "git", "code" ],
|
|
|
|
memberPermissions: [],
|
|
|
|
botPermissions: [ "SEND_MESSAGES", "EMBED_LINKS" ],
|
|
|
|
nsfw: false,
|
|
|
|
ownerOnly: false,
|
|
|
|
cooldown: 5000
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async run (message, args, data) {
|
2021-12-17 21:14:45 +05:00
|
|
|
const res = await fetch("https://api.github.com/repos/JonnyBro/JaBa-new");
|
2021-12-10 21:39:54 +05:00
|
|
|
const json = await res.json();
|
|
|
|
|
|
|
|
const embed = new Discord.MessageEmbed()
|
|
|
|
.setAuthor(this.client.user.tag, this.client.user.displayAvatarURL({ size: 512, dynamic: true, format: 'png' }))
|
2021-12-17 21:14:45 +05:00
|
|
|
.setDescription("["+message.translate("general/github:CLICK_HERE")+"](https://github.com/JonnyBro/JaBa-new)")
|
2021-12-10 21:39:54 +05:00
|
|
|
.addField("Stars", json.stargazers_count, true)
|
|
|
|
.addField("Forks", 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)
|
|
|
|
.setFooter(data.config.embed.footer);
|
|
|
|
|
|
|
|
message.channel.send(embed);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = Github;
|