How do I use GET /channels/{channel.id}/messages - discord.py

I want to make a bot to search through a channel and find a random message by a user. To do that, I need to read past messages. I've looked in the documentation and all it says is GET /channels/{channel.id}/messages.
I'm asking: How could I return the contents of a message and the author of the message (if possible).

If you're using discord.py, take a look at channel.history

Related

Handling multiple user input in RASA

I am making a symptom checker chatbot . And I cannot figure out way to take multiple user input before analyzing it and giving output. Like, taking all the user input then giving the output after analyzing all the inputs given. Forms can be used but i am confused on how to implement on the system.
You can wait for multiple user messages by using action_listen. However, it might be hard to know when to stop listening. Depending on how many messages you're expecting from the user, it may be easiest to have a custom action loop, with the bot saying something like
"Anything else you want to add?", and accumulating the user's responses so they can all be analysed together.

How to find message's file unique IDs with Telegram bot API?

i'm experimenting with Golang Telegram bot APIs and I have a problem with the ID of the message's file that i send to the bot.
I forwarded a message of type VOICE to the bot and in the code I read the unique ID of this file to understand if the bot received that voice message yet (... maybe forwarded by another user).
The problem is that when I read the ID with this code msg.Voice.FileID I get always a different string. But not completely different, the first and last part of the string is always the same, but the middle part changes, like this:
id first time i forward the message: aaaaaa_abc_zzzzz
id second time i forward the message: aaaaaa_def_zzzzz
The doc does not say anything about it... (https://godoc.org/github.com/go-telegram-bot-api/telegram-bot-api)
Do you guys know how to deal with file ids? My goal is to be able to say "ok, I received this photo (or voice, or audio, or video) yet from this or another user"
Thank you for your time
Ve
As a reddit user pointed out here, it is possibile to have the unique id of a file as per v4.5 of the Telegram API https://core.telegram.org/bots/api-changelog#december-31-2019.
I couldn'd find that out because a was reading the Golang implementation godoc and the "unique id" feature is not yet implemented.
I'm going to add it and make a PR.

How to get full Gmail API message when clipped?

Gmail messages are clipped when body is exceeding 102kb. In the UI one can get the entire message with a link in the bottom of the page, however the Gmail API does not display it.
Following the documentation, I did not manage to find any solution whatever the format chosen. The body is well printed but not entire (and no link to read the rest). Am I missing something ?
Short answer : listing messages under threads renders messages with no body limit :)
The documentation does not mention this difference but tried and approved.

Telegram - Counting messages

I'd like to count the messages of a specific conversation in Telegram. There should be a way using Telegram Desktop and using the debugmode to save the log information (see https://telegram.wiki/desktop/tdesktopcountingmessages). Unfortunately the count-tag is missing in most cases. Any other ideas?
The easiest way to do this currently is by searching for '+' in the conversation of interest. This will retrieve all messages and you can see the count from the search results. See attached image for an example. This conversation contains 32 messages in total.

Is it possible to query out all of the "praises" messages from yammer?

Yammer has a feature that allows you to "praise" someone. However, looking at the data that is returned from a "praise" message, it does not appear there is any distinguishing flag or attribute that marks it as a "praise" message. Inside the message, there is an attachment with "type=praise" and then "praised-user-id".
What is the best way to pull this information out of Yammer?
Unfortunately there is no way to pull all praise messages from Yammer at this time. It's worth joining the Yammer Developer Network and tracking updates to the API, but this is not something that I'd expect to see in the near future.
Thinking slightly on a tangent, try using the 'search' API looking for the word 'praised' as this is always in the body. This should return only results containing praised.

Resources