Hi,
With the code below in visual studio code I am getting an error:
msg.user = src.user
^
TypeError: Cannot set property 'user' of undefined
and console.log(bot.user) displays "undefined". The bot successfully receives the message but cannot reply. Do you have an idea why the bot user is undefined?
Thank you
const Botkit = require('../lib/JabberBot.js')
var controller = Botkit({
json_file_store: './bot_store/'
});
var bot = controller.spawn({
client: {
jid: 'mybot@me.com',
password: 'test',
host: 'test',
port: 1111
}
});
controller.hears(['hi'], ['direct_mention', 'direct_message'], function(bot, message) {
console.log(bot.user)
console.log(message.text)
console.log(message.user)
bot.reply('my reply');
});