add banner ctx command

This commit is contained in:
bignutty 2024-05-18 13:59:54 +02:00
parent 8937b5d10c
commit 93a95a0523
4 changed files with 36 additions and 4 deletions

View file

@ -5,7 +5,7 @@ const { createEmbed } = require('../../../labscore/utils/embed');
const { editOrReply } = require('../../../labscore/utils/message');
module.exports = {
name: 'Get User Avatar',
name: 'View User Avatar',
type: ApplicationCommandTypes.USER,
contexts: [
0,

View file

@ -0,0 +1,34 @@
const { Constants } = require('detritus-client');
const { InteractionCallbackTypes, ApplicationCommandTypes } = Constants;
const { createEmbed } = require('../../../labscore/utils/embed');
const { editOrReply } = require('../../../labscore/utils/message');
module.exports = {
name: 'View User Banner',
type: ApplicationCommandTypes.USER,
contexts: [
0,
1,
2
],
integrationTypes: [
1
],
run: async (context, args) => {
try{
await context.respond({ data: {}, type: InteractionCallbackTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE })
let u = await context.client.rest.fetchUser(args.user.id);
if(!u.bannerUrl) return editOrReply(context, createEmbed("warning", context, "User doesn't have a banner set."));
return editOrReply(context, createEmbed("default", context, {
image: {
url: u.bannerUrl + '?size=4096'
}
}))
}catch(e){
console.log(e)
}
},
};

View file

@ -25,7 +25,7 @@ module.exports = {
const { user, member } = args;
let u = user;
let u = await context.client.rest.fetchUser(user.id);;
let m = member;
let botTag = ''

View file

@ -26,8 +26,6 @@ module.exports.maintower = async function (packages, type){
}
module.exports.basecamp = async function (log, content = ""){
// This begins the list of errors that i simply cannot fix. thank you discord.
if(content?.includes(`"code": 200000`)) return;
try{
let res = await superagent.post(MAINTOWER_BASE_URL + 'basecamp')
.set({