Change Github Authorization

This commit is contained in:
Dragon Fire
2020-11-02 12:05:43 -05:00
parent a810bd793c
commit f77adabb35
5 changed files with 11 additions and 10 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ const Command = require('../../structures/Command');
const moment = require('moment');
const { MessageEmbed } = require('discord.js');
const request = require('node-superfetch');
const { shorten, formatNumber, base64 } = require('../../util/Util');
const { GITHUB_USERNAME, GITHUB_PASSWORD } = process.env;
const { shorten, formatNumber } = require('../../util/Util');
const { GITHUB_ACCESS_TOKEN } = process.env;
module.exports = class GithubCommand extends Command {
constructor(client) {
@@ -43,7 +43,7 @@ module.exports = class GithubCommand extends Command {
try {
const { body } = await request
.get(`https://api.github.com/repos/${author}/${repository}`)
.set({ Authorization: `Basic ${base64(`${GITHUB_USERNAME}:${GITHUB_PASSWORD}`)}` });
.set({ Authorization: `token ${GITHUB_ACCESS_TOKEN}` });
const embed = new MessageEmbed()
.setColor(0xFFFFFF)
.setAuthor('GitHub', 'https://i.imgur.com/e4HunUm.png', 'https://github.com/')