mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
sticker support for enlarge
This commit is contained in:
parent
4626383a0d
commit
45868987bb
3 changed files with 30 additions and 31 deletions
|
@ -7,7 +7,6 @@ const Permissions = Constants.Permissions;
|
||||||
const { icon, codeblock, iconPill } = require("../../../labscore/utils/markdown");
|
const { icon, codeblock, iconPill } = require("../../../labscore/utils/markdown");
|
||||||
const { editOrReply } = require("../../../labscore/utils/message");
|
const { editOrReply } = require("../../../labscore/utils/message");
|
||||||
const { STATICS } = require("../../../labscore/utils/statics");
|
const { STATICS } = require("../../../labscore/utils/statics");
|
||||||
const { getMember } = require("../../../labscore/utils/users");
|
|
||||||
|
|
||||||
|
|
||||||
function getPerspectiveColor(score){
|
function getPerspectiveColor(score){
|
||||||
|
|
|
@ -3,7 +3,7 @@ const { emojipedia, emojiKitchen } = require("../../../labscore/api");
|
||||||
|
|
||||||
const { EMOJIPEDIA_PLATFORM_TYPES, EMOJIPEDIA_PLATFORM_TYPE_ALIASES } = require("../../../labscore/constants");
|
const { EMOJIPEDIA_PLATFORM_TYPES, EMOJIPEDIA_PLATFORM_TYPE_ALIASES } = require("../../../labscore/constants");
|
||||||
const { createEmbed } = require("../../../labscore/utils/embed");
|
const { createEmbed } = require("../../../labscore/utils/embed");
|
||||||
const { citation } = require("../../../labscore/utils/markdown");
|
const { icon } = require("../../../labscore/utils/markdown");
|
||||||
const { editOrReply } = require("../../../labscore/utils/message");
|
const { editOrReply } = require("../../../labscore/utils/message");
|
||||||
const { STATICS } = require("../../../labscore/utils/statics");
|
const { STATICS } = require("../../../labscore/utils/statics");
|
||||||
|
|
||||||
|
@ -45,12 +45,26 @@ module.exports = {
|
||||||
],
|
],
|
||||||
run: async (context, args) => {
|
run: async (context, args) => {
|
||||||
await context.triggerTyping()
|
await context.triggerTyping()
|
||||||
|
let msg = context.message;
|
||||||
if (context.message.messageReference) {
|
if (context.message.messageReference) {
|
||||||
let msg = await context.message.channel.fetchMessage(context.message.messageReference.messageId)
|
msg = await context.message.channel.fetchMessage(context.message.messageReference.messageId)
|
||||||
args.emoji = msg.content
|
args.emoji = msg.content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(msg.stickerItems.length){
|
||||||
|
let s = msg.stickerItems.first()
|
||||||
|
if(s.type == 3) return editOrReply(context, createEmbed("default", context, {
|
||||||
|
description: `${icon("sticker")} **${s.name}**\n\nhttps://media.discordapp.net/stickers/${s.id}.json`,
|
||||||
|
}))
|
||||||
|
return editOrReply(context, createEmbed("default", context, {
|
||||||
|
description: `${icon("sticker")} **${s.name}**`,
|
||||||
|
image: {
|
||||||
|
url: `https://media.discordapp.net/stickers/${s.id}.png`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const { matches } = Utils.regex(
|
const { matches } = Utils.regex(
|
||||||
Constants.DiscordRegexNames.EMOJI,
|
Constants.DiscordRegexNames.EMOJI,
|
||||||
args.emoji
|
args.emoji
|
||||||
|
@ -61,7 +75,7 @@ module.exports = {
|
||||||
if(matches[0].animated) form = '.gif'
|
if(matches[0].animated) form = '.gif'
|
||||||
|
|
||||||
return editOrReply(context, createEmbed("default", context, {
|
return editOrReply(context, createEmbed("default", context, {
|
||||||
description: `**${matches[0].name}**`,
|
description: `${icon("emoji")} **${matches[0].name}**`,
|
||||||
image: {
|
image: {
|
||||||
url: `https://cdn.discordapp.com/emojis/${matches[0].id}${form}`
|
url: `https://cdn.discordapp.com/emojis/${matches[0].id}${form}`
|
||||||
}
|
}
|
||||||
|
@ -77,7 +91,6 @@ module.exports = {
|
||||||
|
|
||||||
// Emoji Mixing
|
// Emoji Mixing
|
||||||
if(emoji.length >= 2){
|
if(emoji.length >= 2){
|
||||||
try{
|
|
||||||
let em = await emojiKitchen(emoji)
|
let em = await emojiKitchen(emoji)
|
||||||
if(!em.body.results[0]){
|
if(!em.body.results[0]){
|
||||||
for(const em of emoji){
|
for(const em of emoji){
|
||||||
|
@ -91,20 +104,6 @@ module.exports = {
|
||||||
return editOrReply(context, createEmbed("error", context, "Combination not supported."))
|
return editOrReply(context, createEmbed("error", context, "Combination not supported."))
|
||||||
}
|
}
|
||||||
return editOrReply(context, createEmbed("image", context, { url: em.body.results[0].url }))
|
return editOrReply(context, createEmbed("image", context, { url: em.body.results[0].url }))
|
||||||
|
|
||||||
}catch(e){
|
|
||||||
console.log(e)
|
|
||||||
return context.editOrReply({
|
|
||||||
embed: {
|
|
||||||
author: {
|
|
||||||
iconUrl: context.message.author.avatarUrl,
|
|
||||||
name: `${context.message.author.username}#${context.message.author.discriminator}`
|
|
||||||
},
|
|
||||||
color: Colors.error,
|
|
||||||
description: `${Icons.error} You need two emoji to mix.`,
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regular Emoji Handling
|
// Regular Emoji Handling
|
||||||
|
|
|
@ -38,7 +38,6 @@ module.exports.ICONS = Object.freeze({
|
||||||
"connection": "<:ico_connection:903282945551388702>",
|
"connection": "<:ico_connection:903282945551388702>",
|
||||||
"cross": "<:ico_cross:925813919577153639>",
|
"cross": "<:ico_cross:925813919577153639>",
|
||||||
"downloading": "<:ico_downloading:903301897027452998>",
|
"downloading": "<:ico_downloading:903301897027452998>",
|
||||||
"emoji": "<:ico_emoji:903265030823374928>",
|
|
||||||
"fun": "<:ico_fun:903260112657981510>",
|
"fun": "<:ico_fun:903260112657981510>",
|
||||||
"house": "<:ico_house:903263528591429702>",
|
"house": "<:ico_house:903263528591429702>",
|
||||||
"image": "<:ico_image:903259583475240961>",
|
"image": "<:ico_image:903259583475240961>",
|
||||||
|
@ -92,6 +91,8 @@ module.exports.ICONS = Object.freeze({
|
||||||
"arrow_down": "<:ico_arrowdown:980237911008092160>",
|
"arrow_down": "<:ico_arrowdown:980237911008092160>",
|
||||||
"arrow_left": "<:ico_arrowleft:1086628775644647464>",
|
"arrow_left": "<:ico_arrowleft:1086628775644647464>",
|
||||||
"arrow_right": "<:ico_arrowright:1086628777880191016>",
|
"arrow_right": "<:ico_arrowright:1086628777880191016>",
|
||||||
|
"sticker": "<:ico_sticker:1096937131793985546> ",
|
||||||
|
"emoji": "<:ico_emoji:1096936794731315251>"
|
||||||
})
|
})
|
||||||
|
|
||||||
const GUILD_FEATURE_ICONS = Object.freeze({
|
const GUILD_FEATURE_ICONS = Object.freeze({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue