mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 14:13:02 -04:00
make labscore icon in footer use brand static
This commit is contained in:
parent
07893bba18
commit
c2c8241080
7 changed files with 22 additions and 8 deletions
|
@ -5,6 +5,7 @@ const superagent = require('superagent');
|
||||||
const { getRecentImage } = require("../../../labscore/utils/attachment");
|
const { getRecentImage } = require("../../../labscore/utils/attachment");
|
||||||
|
|
||||||
const { Permissions } = require("detritus-client/lib/constants");
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
const { STATICS } = require("../../../labscore/utils/statics");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'anime',
|
name: 'anime',
|
||||||
|
@ -69,7 +70,7 @@ module.exports = {
|
||||||
let embeds = [];
|
let embeds = [];
|
||||||
let files = [];
|
let files = [];
|
||||||
|
|
||||||
embeds.push(createEmbed("default", context, {image: {url:`attachment://anime.png`}, url: `https://example.com`, footer: { iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`, text: `${context.application.name} • Took ${((Date.now() - t) / 1000).toFixed(2)}s` }}))
|
embeds.push(createEmbed("default", context, {image: {url:`attachment://anime.png`}, url: `https://example.com`, footer: { iconUrl: STATICS.labscore, text: `${context.application.name} • Took ${((Date.now() - t) / 1000).toFixed(2)}s` }}))
|
||||||
files.push({
|
files.push({
|
||||||
filename: `anime.png`,
|
filename: `anime.png`,
|
||||||
value: Buffer.from(img.body.image, 'base64')
|
value: Buffer.from(img.body.image, 'base64')
|
||||||
|
|
|
@ -4,6 +4,7 @@ const { editOrReply } = require("../../../labscore/utils/message");
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
const { Permissions } = require("detritus-client/lib/constants");
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
const { STATICS } = require("../../../labscore/utils/statics");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'dalle',
|
name: 'dalle',
|
||||||
|
@ -49,7 +50,7 @@ module.exports = {
|
||||||
let files = [];
|
let files = [];
|
||||||
|
|
||||||
for(let i = 0; i < 4; i++){
|
for(let i = 0; i < 4; i++){
|
||||||
embeds.push(createEmbed("default", context, {image: {url:`attachment://dalle${i}.jpeg`}, url: `https://example.com`, footer: { iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`, text: `${context.application.name} • Took ${((Date.now() - t) / 1000).toFixed(2)}s` }}))
|
embeds.push(createEmbed("default", context, {image: {url:`attachment://dalle${i}.jpeg`}, url: `https://example.com`, footer: { iconUrl: STATICS.labscore, text: `${context.application.name} • Took ${((Date.now() - t) / 1000).toFixed(2)}s` }}))
|
||||||
files.push({
|
files.push({
|
||||||
filename: `dalle${i}.jpeg`,
|
filename: `dalle${i}.jpeg`,
|
||||||
value: Buffer.from(img.body.images[i], 'base64')
|
value: Buffer.from(img.body.images[i], 'base64')
|
||||||
|
|
|
@ -4,6 +4,7 @@ const { editOrReply } = require("../../../labscore/utils/message");
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
const { Permissions } = require("detritus-client/lib/constants");
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
const { STATICS } = require("../../../labscore/utils/statics");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'stability',
|
name: 'stability',
|
||||||
|
@ -50,7 +51,7 @@ module.exports = {
|
||||||
let files = [];
|
let files = [];
|
||||||
|
|
||||||
for(let i = 0; i < 4; i++){
|
for(let i = 0; i < 4; i++){
|
||||||
embeds.push(createEmbed("default", context, {image: {url:`attachment://stability${i}.jpeg`}, url: `https://example.com`, footer: { iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`, text: `${context.application.name} • Took ${((Date.now() - t) / 1000).toFixed(2)}s` }}))
|
embeds.push(createEmbed("default", context, {image: {url:`attachment://stability${i}.jpeg`}, url: `https://example.com`, footer: { iconUrl: STATICS.labscore, text: `${context.application.name} • Took ${((Date.now() - t) / 1000).toFixed(2)}s` }}))
|
||||||
files.push({
|
files.push({
|
||||||
filename: `stability${i}.jpeg`,
|
filename: `stability${i}.jpeg`,
|
||||||
value: Buffer.from(img.body.images[i].replace('data:image/jpeg;base64,',''), 'base64')
|
value: Buffer.from(img.body.images[i].replace('data:image/jpeg;base64,',''), 'base64')
|
||||||
|
|
|
@ -7,6 +7,7 @@ const { codeblock, icon } = require('../../../labscore/utils/markdown');
|
||||||
const superagent = require('superagent');
|
const superagent = require('superagent');
|
||||||
|
|
||||||
const { Permissions } = require("detritus-client/lib/constants");
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
const { STATICS } = require('../../../labscore/utils/statics');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'qr',
|
name: 'qr',
|
||||||
|
@ -76,7 +77,7 @@ module.exports = {
|
||||||
url: image
|
url: image
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`,
|
iconUrl: STATICS.labscore,
|
||||||
text: `labsCore • Took ${((Date.now() - t) / 1000).toFixed(2)}s`
|
text: `labsCore • Took ${((Date.now() - t) / 1000).toFixed(2)}s`
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
5
labscore/utils/cdn.js
Normal file
5
labscore/utils/cdn.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
const CDN = "https://cdn.discordapp.com"
|
||||||
|
|
||||||
|
const cdnUrl = (route, size, format) => `${CDN}${route}.${format}?size=${size}`
|
||||||
|
|
||||||
|
module.exports.guildIcon = (id, hash, size = 4096, format = "png") => cdnUrl(`/icons/${id}/${hash}`, size, format)
|
|
@ -1,12 +1,12 @@
|
||||||
const { COLORS } = require('../constants')
|
const { COLORS } = require('../constants')
|
||||||
const { STATIC_ICONS } = require('./statics')
|
const { STATIC_ICONS, STATICS } = require('./statics')
|
||||||
|
|
||||||
const embedTypes = Object.freeze({
|
const embedTypes = Object.freeze({
|
||||||
"default": (context) => {
|
"default": (context) => {
|
||||||
return {
|
return {
|
||||||
color: COLORS.embed,
|
color: COLORS.embed,
|
||||||
footer: {
|
footer: {
|
||||||
iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`,
|
iconUrl: STATICS.labscore,
|
||||||
text: context.application.name
|
text: context.application.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ const embedTypes = Object.freeze({
|
||||||
return {
|
return {
|
||||||
color: COLORS.embed,
|
color: COLORS.embed,
|
||||||
footer: {
|
footer: {
|
||||||
iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`,
|
iconUrl: STATICS.labscore,
|
||||||
text: context.application.name
|
text: context.application.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ module.exports.createEmbed = function(type, context, content){
|
||||||
return emb
|
return emb
|
||||||
}
|
}
|
||||||
|
|
||||||
if(content && content.footer && !content.footer.iconUrl) content.footer.iconUrl = `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`
|
if(content && content.footer && !content.footer.iconUrl) content.footer.iconUrl = STATICS.labscore
|
||||||
|
|
||||||
if(["image"].includes(type)){
|
if(["image"].includes(type)){
|
||||||
if(content.url.includes('://')){
|
if(content.url.includes('://')){
|
||||||
|
|
|
@ -32,6 +32,10 @@ const Statics = Object.freeze({
|
||||||
file: "brands/inspirobot.png",
|
file: "brands/inspirobot.png",
|
||||||
revision: 0
|
revision: 0
|
||||||
},
|
},
|
||||||
|
labscore: {
|
||||||
|
file: "brands/labscore.png",
|
||||||
|
revision: 0
|
||||||
|
},
|
||||||
makesweet: {
|
makesweet: {
|
||||||
file: "brands/makesweet.png",
|
file: "brands/makesweet.png",
|
||||||
revision: 0
|
revision: 0
|
||||||
|
@ -113,6 +117,7 @@ module.exports.STATICS = Object.freeze({
|
||||||
emojipedia: staticAsset(Statics.brands.emojipedia),
|
emojipedia: staticAsset(Statics.brands.emojipedia),
|
||||||
inferkit: staticAsset(Statics.brands.inferkit),
|
inferkit: staticAsset(Statics.brands.inferkit),
|
||||||
inspirobot: staticAsset(Statics.brands.inspirobot),
|
inspirobot: staticAsset(Statics.brands.inspirobot),
|
||||||
|
labscore: staticAsset(Statics.brands.labscore),
|
||||||
makesweet: staticAsset(Statics.brands.makesweet),
|
makesweet: staticAsset(Statics.brands.makesweet),
|
||||||
openweathermap: staticAsset(Statics.brands.openweathermap),
|
openweathermap: staticAsset(Statics.brands.openweathermap),
|
||||||
perspectiveapi: staticAsset(Statics.brands.perspectiveapi),
|
perspectiveapi: staticAsset(Statics.brands.perspectiveapi),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue