mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
add banner ctx command
This commit is contained in:
parent
8937b5d10c
commit
93a95a0523
4 changed files with 36 additions and 4 deletions
|
@ -5,7 +5,7 @@ const { createEmbed } = require('../../../labscore/utils/embed');
|
||||||
const { editOrReply } = require('../../../labscore/utils/message');
|
const { editOrReply } = require('../../../labscore/utils/message');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'Get User Avatar',
|
name: 'View User Avatar',
|
||||||
type: ApplicationCommandTypes.USER,
|
type: ApplicationCommandTypes.USER,
|
||||||
contexts: [
|
contexts: [
|
||||||
0,
|
0,
|
||||||
|
|
34
commands/interaction/user/banner.js
Normal file
34
commands/interaction/user/banner.js
Normal 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)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
|
@ -25,7 +25,7 @@ module.exports = {
|
||||||
|
|
||||||
const { user, member } = args;
|
const { user, member } = args;
|
||||||
|
|
||||||
let u = user;
|
let u = await context.client.rest.fetchUser(user.id);;
|
||||||
let m = member;
|
let m = member;
|
||||||
|
|
||||||
let botTag = ''
|
let botTag = ''
|
||||||
|
|
|
@ -26,8 +26,6 @@ module.exports.maintower = async function (packages, type){
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports.basecamp = async function (log, content = ""){
|
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{
|
try{
|
||||||
let res = await superagent.post(MAINTOWER_BASE_URL + 'basecamp')
|
let res = await superagent.post(MAINTOWER_BASE_URL + 'basecamp')
|
||||||
.set({
|
.set({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue