mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -04:00
hide buttons if no similar emoji are available
This commit is contained in:
parent
98d251b994
commit
602b68ad91
2 changed files with 19 additions and 4 deletions
|
@ -99,7 +99,7 @@ module.exports = {
|
|||
})
|
||||
|
||||
components.clear();
|
||||
for(const e of newView.data.metadata.similar.splice(0, 5)){
|
||||
if(newView.data.metadata.similar) for(const e of newView.data.metadata.similar.splice(0, 5)){
|
||||
components.addButton({
|
||||
customId: e,
|
||||
emoji: e,
|
||||
|
@ -107,11 +107,13 @@ module.exports = {
|
|||
})
|
||||
}
|
||||
|
||||
if(!newView.data.metadata.similar) return await ctx.editOrRespond({embeds: [currentView]})
|
||||
|
||||
await ctx.editOrRespond({embeds: [currentView], components})
|
||||
}
|
||||
})
|
||||
|
||||
for(const e of res.data.metadata.similar.splice(0, 5)){
|
||||
if(res.data.metadata.similar) for(const e of res.data.metadata.similar.splice(0, 5)){
|
||||
components.addButton({
|
||||
customId: e,
|
||||
emoji: e,
|
||||
|
@ -119,6 +121,13 @@ module.exports = {
|
|||
})
|
||||
}
|
||||
|
||||
setTimeout(()=>{
|
||||
editOrReply(context, {
|
||||
embeds:[currentView],
|
||||
components:[]
|
||||
})
|
||||
}, 100000)
|
||||
|
||||
// Use the high-res emojipedia icon, if available
|
||||
let ico = `https://abs.twimg.com/emoji/v2/72x72/${toCodePoint(emoji[0])}.png`
|
||||
if(!res.data.platforms["twitter"]) ico = Object.values(res.data.platforms)[0].images[0].src
|
||||
|
@ -139,6 +148,8 @@ module.exports = {
|
|||
}
|
||||
})
|
||||
|
||||
if(!res.data.metadata.similar) return await editOrReply(context, currentView)
|
||||
|
||||
return editOrReply(context, {
|
||||
embeds: [currentView],
|
||||
components
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue