I am working on a chatbot for school that solves problems in my school.
(我正在为学校的聊天机器人工作,可以解决学校的问题。)
So basically I'm stuck on this part because I have no idea how to do this...(所以基本上我会停留在这部分上,因为我不知道该怎么做...)
So lets say I have the sentence:
(所以说我有这句话:)
Hi, I have a problem in classroom 108
(嗨,我在教室108有问题)
The value "classroom 108" is equal to the value "classroom 108" in my array.
(在我的数组中,值“教室108”等于值“教室108”。)
var classroom= [
{
L108: ["classroom 108","L108"]
},{
L208: ["classroom 208","L208"]
}
];
So now I want to write a message to another channel containing the variable "L108".
(因此,现在我想向另一个包含变量“ L108”的通道写入一条消息。)
function handleMessage(message) {
classroom.forEach((value, index) => {
if (message.includes(classroom)) {
classroom();
console.log(message);
};
})
};
function classroom(message) {
const params = {
icon_emoji: ':smiley:'
}
textchannel = probleemoplosser + ", een docent heeft een probleem met het " + probleem + " in ",classroom, params;
reactie = "Top, ik heb het doorgegeven aan " + naam;
bot.postMessageToChannel( otherchannel,textchannel,params);
bot.postMessageToChannel('general',reactie, params);
};
I don't have much experience with JavaScript so any help is welcome...thanks in advance!<3
(我没有JavaScript的丰富经验,因此欢迎您提供任何帮助...在此先感谢!<3)
ask by Martijn_- translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…