Discord bot can't show emote "sometimes" - node.js

As a french Gwent player, I built a discord bot (using node.js and discord.js) to show the infos of a card when you name it. It uses some custom emotes to show some part of it.
It worked well for a few weeks, but recently some cards don't show the emotes when called.
I have no clue about what could be wrong. The emotes work if you use it yourself on the channel. Some cards show the emotes, others don't, even if they use the same emotes. And it's always all emotes or none for each card.
I checked different cards from my database : with or without emotes, I can't get any specific element which can explain why some cards can have emotes and why some cannot.
Is there something to know here that can explain this situation ?

Although this a late answer and you may have found an answer to the question but I'm going to post an answer anyways for others.
First in the chat you have to type:
\:custom_emote_here:
so in your case, you want it to show
and the name of it was :number5:, you would type :number5:.
You would get something like this:
(of course, it would say :number5: and the start and the numbers would be different)
You can copy and paste that into your code.
For example:
message.channel.send("<:super_magical:366208548914331659>")
would show this:
Hope this helps!
javascriptdiscorddiscord.jsemote

The developers of Discord have recently changed the way bots work with regards to custom emoji.
Before May 16th, bots could use any custom emoji from any server provided they are used inside rich embeds, as shown in your screenshot.
After that date, bots can use custom emoji from shared servers, but do not have to limit it to rich embeds only.
If you have the bot join all the servers that these custom emoji are being hosted on then it will be able to start using the emotes again.

I know that this question was asked quite a whiles ago but I thought I'd offer a solution I found after recently running into this issue myself for anyone else also facing this problem.
Normally, when you send an emoji in a message or embed via the <:name:id> format, Discord will convert it to a custom emoji. However, there are two cases where it represents all custom emojis in a message in the :name: format as shown in your example.
If one of the custom emojis you are trying to send are no longer active in the server (i.e. you have removed it from the server).
If you are trying to send an animated emoji via the <:name:id> format.
If either of the above two conditions are met, it seems like Discord defaults to converting all emojis in the message to :name: rather than the actual custom emoji.
I fixed it for myself by making sure that all of the emojis currently exist in the server emoji list before sending them. For animated emoji, you should send it via the <:a:name:id> format instead.

Related

Send a sticker with text added through pyrogram

I've discovered #Vulcybot on telegram which allows people to add text to a furry 'sign' sticker like so...
example
The user allows the submition of your own furry sticker to the bot.. However I don't want people to be able to use it.. I'd rather it just be either my user ID that can use my sticker or a secretive command only I know.
I have the sticker already made.. I'm just looking for a guide on how to make something like this?
Many thanks
Arlo!
I have tried a few queries on google but there seems to be absolutely nothing on the topic.

How to remove simple response when displaying list card in actions on google for phone surface

Hi i'm having facing a problem that i have selected phone surface where returning both simple response and list card.But in display i'm getting both in simulator.How to remove the simple response when using or displaying list card.
This requirement is for both google home mini and assistant in phone.
Here i need to clear that their is no request from user by clicking
list card.It is only meant for display purpose.
whether my way of implementation is wrong or not don't know correct me if i am wrong.But is it possible to remove or any other way to get rid of the simple response?
Keep in mind that you must have at least one SimpleResponse, in addition to any other RichResponses you may send. This SimpleResponse can contain a blank space - but it must exist. (It should, however, probably include more than a blank space.)
Use following code to detect the Surface
const screenAvailable = conv.available.surfaces.capabilities.has('actions.capability.SCREEN_OUTPUT');
If Surface present, only use UI based response.
If Surface is not present, only use simple response.
Test on a real mobile device and home as simulator shows extra information during simulation.

How to correctly utilize Zip Code entity for DialogFlow?

I'm currently trying to use the built in entity '#sys.zip-code' from DialogFlow (formerly API.AI) for capturing Zip Codes. However so far it does not seem to recognize any actual zipcodes except those which I explicitly set through training. It also does not recognize the '5 digit' pattern as a possible match if #sys.phone-numbers is used in another intent (ex: 54545 gets recognized as a phone number, rather than a zip).
Should I upload a list of known zipcodes through the training section to get this working? Or is there something I'm missing from the built in functionality? Haven't seen a ton of info online on how to best utilize this entity, so figured I'd ask here before coming up with a custom solution.
Thanks in advance!
I think the best way to prompt a user when the bot says something like "could I get your name and zip code? ".The intent which i have created contains multiple combinations of “User says”.They are as below
#"#sys.given-name #sys.zip-code"
#"#sys.zip-code #sys.given-name"
#"#sys.given-name"
#"#sys.zip-code"
and I also have required Parameters setup to pick these values with prompt messages.
So I have attached a picture for this which i have iterated

How can I configure QnAMaker tool to modify liststyle button in Skype?

I have made a bot using QnA Maker and Node JS which is running on Skype.
When the user inputs a word which has got multiple matches in FAQ link or document uploaded in QnA Maker, it shows button of choice using QnAMakerTool module from Node. My question is when the multiple matches has same initial words then because of the size of the choice button in Skype the half of the texts get hide. For example, I have three matches like
Whom should I contact for parking?
Whom should I contact for canteen?
Whom should I contact for Stationery?
It shows in Skype as
Whom should I contact for...
Whom should I contact for...
Whom should I contact for...
If the option text is too long then few parts get hidden. What can I do for this?
First of all, there is a limitation on the max characters in Skype, so that's something you will have to live with. However, you can implement some custom logic to change the text being shown.
That current logic that you are seeing is on the QnAMakerTools file.
The way to go here is probably providing your own QnAMakerTools implementation (it needs to follow this interface).
The QnAMakerDialog receives an IQnAMakerOptions parameter. One of the properties of that interface is feedbackLib which basically is the QnAMakerTools instance that the dialog will later use to disambiguate the question as you can see here.

telegram bot prefill text for user to edit

Telegram bot sends me a message with a text snippet, which I want to edit, and send back to the bot for further processing.
Copy and paste takes time. Typing message anew takes time.
Ideally I'd like to press an inline button "Edit" on the bot's message and get the message text appear in my reply input box for editing.(A message id attached to my reply somehow would be a plus).
I tried to use deep linking with parameters other than /start*, but that doesn't seem to work.
Can I use bot API (or any other telegram API) to have text ready for editing in my input box?
It's impossible in official apps yet. Your question is about working with drafts - there are no methods in both API to create them or clear.
Nevertheless, you could fork any official app stored on GiHub and implement what you need if you would prefer a hard way, but compared to that copy/past solution seems much more easier, isn't it?
UPD
I can offer to you a new idea how to solve your problem - hope it will be helpful.
This is about switch_inline_query_current_chat field of InlineKeyboardButton. Just attach an inline button to messages you need to edit. Set a text for this field gotten from recieved message and after pressing you will get this text to your input area. All seems good, but you will take bot's username before the text also.

Resources