Hello there. I’m newbie, just made a simple bot via twitch-js and have a difficult with it while using ifttt events. Is there any simple decision to resolve my problem?
Here is the code:
const tmi = require(“twitch-js”);
const option = {
options: {
debug: true
},
connection: {
reconnect: true
},
identity: {
username: “project_name”,
password: “oauth:xxxxx”
},
channels: [“project_name”]
};
const client = new tmi.client(option);
client.connect();
client.on(“chat”, (channel, user, message, self) => {
client.action(“project_name is online!”);
if(message === “!hi”){
client.action(“project_name”, “Hi there!”);
}
if(message === “!1”){
client.action(“curl -X POST https://maker.ifttt.com/trigger/chat_message/with/key/xxxxx”);
}
});
I’m stuck in this part:
if(message === “!1”){
client.action(“curl -X POST https://maker.ifttt.com/trigger/chat_message/with/key/xxxxx”);
}
});
Whenever I’m using this command via cmd, locally on my machine, it’s triggers my ifttt event. I need to run this command via twitch chat from any user with command !1 .
Thanks for your attention and any help!