mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-11 15:43:03 -04:00
detailed emoji info
This commit is contained in:
parent
939fef9b33
commit
98d251b994
5 changed files with 304 additions and 20 deletions
|
@ -31,7 +31,6 @@ function toCodePoint(unicodeSurrogates, sep) {
|
|||
return r.join(sep || '-');
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'emoji',
|
||||
description: 'Turn emoji into images. Supports both built-in and custom emoji.',
|
||||
|
@ -150,9 +149,7 @@ module.exports = {
|
|||
if (ctx.userId !== context.userId) return await ctx.respond(InteractionCallbackTypes.DEFERRED_UPDATE_MESSAGE);
|
||||
|
||||
// this sucks but works, ensures the newly selected option stays selected
|
||||
// update 25/03/24 - it sucks even more now
|
||||
console.log(ctx.data)
|
||||
|
||||
// update 25/03/24 - it sucks even more now
|
||||
|
||||
if(ctx.data.customId == "emoji-type"){
|
||||
currentPlatform = ctx.data.values[0];
|
||||
|
@ -172,21 +169,17 @@ module.exports = {
|
|||
|
||||
components.components[1].components[0].options = newVersionOptions
|
||||
|
||||
console.log("new type is " + currentPlatform + " with version " + currentRevision)
|
||||
} else if(ctx.data.customId == "emoji-version"){
|
||||
|
||||
for (let i = 0; i < components.components[1].components[0].options.length; i++) {
|
||||
components.components[1].components[0].options[i].default = (components.components[1].components[0].options[i].value == ctx.data.values[0])
|
||||
}
|
||||
currentRevision = ctx.data.values[0];
|
||||
console.log("new version is " + currentRevision);
|
||||
}
|
||||
|
||||
console.log("getting asset for " + currentPlatform + " ver " + currentRevision);
|
||||
const emojiAsset = res.data.platforms[currentPlatform].images.filter((p)=>{
|
||||
return p.id == currentRevision
|
||||
})
|
||||
console.log("got asset: " + emojiAsset)
|
||||
|
||||
currentView = createEmbed("default", context, {
|
||||
author: {
|
||||
|
@ -204,9 +197,7 @@ module.exports = {
|
|||
}
|
||||
})
|
||||
|
||||
console.log("acknowledging for plat " + currentPlatform + " and ver " + currentRevision)
|
||||
await ctx.editOrRespond({embeds: [currentView], components})
|
||||
console.log("acknowledged")
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue