Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
155 views
in Technique[技术] by (71.8m points)

javascript - 如何将用户输入中的某个值复制到另一个通道?(How to copy a certain value in users input to another channel?)

I am currentyl making a chatbot for a school project that solves problem around my school.

(我目前正在为一个学校项目制作聊天机器人,该项目可以解决学校周围的问题。)

But I havo no idea how to do this part of the code.

(但是我不知道如何执行这部分代码。)

Basically what I want to do is 'copy' a value of the users input that is equal to a value in my array to another channel.

(基本上,我想做的是将用户输入的值“复制”到另一个通道中,该值等于我数组中的值。)

My array looks like this:

(我的数组如下所示:)

var classroom= [
    {
        L108: ["classroom 108","L108","108", "classroom L108"]
    },{
        L208: ["classroom 208","L208","208","classroom L208"]
    }
];

So lets say that I have the sentence:

(所以说我有这样一句话:)

I have a problem in classroom L108

(我在L108教室遇到问题)

Out of this sentence I want the value 'classroom L108' to be copied to another channel.

(在这句话中,我希望将值“ classroom L108”复制到另一个通道。)

 function classroom(message) {
    const params = {
        icon_emoji: ':smiley:'
    }
    textchannel = probleemoplosser + ", a teacher has a problem with the " + probleem + " in ",classroom, params;
    reactie =  "Top, ik heb het doorgegeven aan " + naam;
    bot.postMessageToChannel( channel,textchannel,params);
    bot.postMessageToChannel('general',reactie, params);

I hope I explained it well... :) thanks in advance!

(我希望我解释得很好... :)预先感谢!)

  ask by Martijn_- translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...