various fixes

This commit is contained in:
bignutty 2024-07-14 17:13:04 +02:00
parent a7fcad82a9
commit ddbef1267e
3 changed files with 27 additions and 115 deletions

View file

@ -7,6 +7,8 @@ const { Permissions } = require("detritus-client/lib/constants");
const superagent = require('superagent');
const { Routes } = require('detritus-client-rest/lib/endpoints');
const applicationFlags = {
EMBEDDED_RELEASED: 1,
GATEWAY_PRESENCE: 12,
@ -59,14 +61,14 @@ module.exports = {
let application;
let assets;
try{
application = await superagent.get(`https://discord.com/api/v9/applications/${id}/rpc`)
application = await superagent.get(`${Routes.URL}/api/v9/applications/${id}/rpc`)
application = application.body
}catch(e){
return editOrReply(context, createEmbed("warning", context, "Invalid Application"))
}
try{
assets = await superagent.get(`https://discord.com/api/oauth2/applications/${id}/assets`)
assets = await superagent.get(`${Routes.URL}/api/oauth2/applications/${id}/assets`)
assets = assets.body
}catch(e){
// :)