mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -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 { Permissions } = require("detritus-client/lib/constants");
|
||||
const { STATICS } = require("../../../labscore/utils/statics");
|
||||
|
||||
module.exports = {
|
||||
name: 'anime',
|
||||
|
@ -69,7 +70,7 @@ module.exports = {
|
|||
let embeds = [];
|
||||
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({
|
||||
filename: `anime.png`,
|
||||
value: Buffer.from(img.body.image, 'base64')
|
||||
|
|
|
@ -4,6 +4,7 @@ const { editOrReply } = require("../../../labscore/utils/message");
|
|||
const superagent = require('superagent');
|
||||
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
const { STATICS } = require("../../../labscore/utils/statics");
|
||||
|
||||
module.exports = {
|
||||
name: 'dalle',
|
||||
|
@ -49,7 +50,7 @@ module.exports = {
|
|||
let files = [];
|
||||
|
||||
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({
|
||||
filename: `dalle${i}.jpeg`,
|
||||
value: Buffer.from(img.body.images[i], 'base64')
|
||||
|
|
|
@ -4,6 +4,7 @@ const { editOrReply } = require("../../../labscore/utils/message");
|
|||
const superagent = require('superagent');
|
||||
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
const { STATICS } = require("../../../labscore/utils/statics");
|
||||
|
||||
module.exports = {
|
||||
name: 'stability',
|
||||
|
@ -50,7 +51,7 @@ module.exports = {
|
|||
let files = [];
|
||||
|
||||
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({
|
||||
filename: `stability${i}.jpeg`,
|
||||
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 { Permissions } = require("detritus-client/lib/constants");
|
||||
const { STATICS } = require('../../../labscore/utils/statics');
|
||||
|
||||
module.exports = {
|
||||
name: 'qr',
|
||||
|
@ -76,7 +77,7 @@ module.exports = {
|
|||
url: image
|
||||
},
|
||||
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`
|
||||
}
|
||||
}))
|
||||
|
|
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 { STATIC_ICONS } = require('./statics')
|
||||
const { STATIC_ICONS, STATICS } = require('./statics')
|
||||
|
||||
const embedTypes = Object.freeze({
|
||||
"default": (context) => {
|
||||
return {
|
||||
color: COLORS.embed,
|
||||
footer: {
|
||||
iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`,
|
||||
iconUrl: STATICS.labscore,
|
||||
text: context.application.name
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ const embedTypes = Object.freeze({
|
|||
return {
|
||||
color: COLORS.embed,
|
||||
footer: {
|
||||
iconUrl: `https://cdn.discordapp.com/avatars/${context.application.id}/${context.application.icon}.png?size=256`,
|
||||
iconUrl: STATICS.labscore,
|
||||
text: context.application.name
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ module.exports.createEmbed = function(type, context, content){
|
|||
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(content.url.includes('://')){
|
||||
|
|
|
@ -32,6 +32,10 @@ const Statics = Object.freeze({
|
|||
file: "brands/inspirobot.png",
|
||||
revision: 0
|
||||
},
|
||||
labscore: {
|
||||
file: "brands/labscore.png",
|
||||
revision: 0
|
||||
},
|
||||
makesweet: {
|
||||
file: "brands/makesweet.png",
|
||||
revision: 0
|
||||
|
@ -113,6 +117,7 @@ module.exports.STATICS = Object.freeze({
|
|||
emojipedia: staticAsset(Statics.brands.emojipedia),
|
||||
inferkit: staticAsset(Statics.brands.inferkit),
|
||||
inspirobot: staticAsset(Statics.brands.inspirobot),
|
||||
labscore: staticAsset(Statics.brands.labscore),
|
||||
makesweet: staticAsset(Statics.brands.makesweet),
|
||||
openweathermap: staticAsset(Statics.brands.openweathermap),
|
||||
perspectiveapi: staticAsset(Statics.brands.perspectiveapi),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue