How to send Particle commands from chats - Twitch, Telegram, YouTube, etc

I need to be able to receive and process commands that are sent to my Particle via chat apps. Twitch, ideally, or Telegram, or YouTube. I can find some examples on the web of chat-controlled devices that aren’t Particles, but nothing specifically for this system. (seems like it should be easier with a Particle anyways?)

I’ve been able to send text from my Particle to chat apps, I just need the reverse now. I want to have certain “commands” entered in a Twitch chat trigger things to happen on my device.

Are there any similar projects I should be looking at? I’d appreciate any guidance on how to approach starting this project.

Hi and welcome to the community!

I think from Telegram you could instruct a bot to send commands to your Particle.
If that is the case, this topic can get you halfway there:

Thanks! I followed the info in that link a few days ago and got sending messages to Telegram to work. The reverse seems more complicated to me. I’m very new to this so I appreciate the feedback. Here’s how I’m guessing this could work… I set a Telegram bot up with a webhook (Telegram Bot API) that sends all updates (messages, etc) it gets to the Particle Cloud API (using my specific device id and token somehow). The content of those updates from Telegram will look something like this:

{
“update_id”:987654321,
“message”: {
“message_id”:14,
“from”: {
“id”:123456789,
“is_bot”:false,
“first_name”:“Name”,
“username”:“Username”,
“language_code”:“en”
},
“chat”: {
“id”:123456789,
“first_name”:“Name”,
“username”:“Username”,
“type”:“private”},
“date”:1631453675,
“text”:“/hellobot”,
“entities”: [
{
“offset”:0,
“length”:9,
“type”:“bot_command”
}
]
}
}

And I’d need to have a function running on my particle to grab the data in the “text” field, and if it matches what I want, then the function does the thing I want?

Do I have the basic flow down, and just need to figure out the specifics of each step? Or am I way off? lol.

Hey, that sounds like the plan I would execute.
Best of luck and if you get stuck along the way, don’t hesitate to ask again in the community.