Browse Source

logs, bots @0.1.2

push-params
Evan Feenstra 5 years ago
parent
commit
f893fe68fc
  1. 1
      api/bots/index.ts
  2. 2
      api/controllers/bots.ts
  3. 6
      package-lock.json
  4. 2
      package.json

1
api/bots/index.ts

@ -9,6 +9,7 @@ function emit(txt, chatUUID){
const arr = txt.split(' ')
if(arr.length<2) return false
// const cmd = arr[1]
console.log('===> EMIT BOT MSG',{content:txt,chatUUID})
Sphinx.EE.emit('message',{content:txt,chatUUID})
// switch(cmd) {
// case 'install':

2
api/controllers/bots.ts

@ -60,7 +60,9 @@ export const deleteBot = async (req, res) => {
// return bool whether this is legit to process
export async function processBotMessage(msg:Msg, chat, botInTribe): Promise<boolean> {
console.log('===> PROCESS BOT MSG')
const txt = msg.message.content
console.log('===> txt',txt)
if(txt.startsWith('/bot ')){
emitBotMsg(txt, chat.uuid)
} else {

6
package-lock.json

@ -10876,9 +10876,9 @@
}
},
"sphinx-bot": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/sphinx-bot/-/sphinx-bot-0.1.1.tgz",
"integrity": "sha512-MSbNcpq8ZTBoaCyIhNRTMLOLsj99n29PcUylsQYCtb0pZ6SILlQBM5hCnfZbSoHef2boO8gCeB94l0qZCK5Aow==",
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/sphinx-bot/-/sphinx-bot-0.1.2.tgz",
"integrity": "sha512-sIPk3Up2I4tI+nE6RfMKlh0mWVUpEbQXUYBts1TW8z6OhF27o+guMvp1KKJKd0dqZDIxO/ucB9zLKAY54RDYog==",
"requires": {
"eventemitter3": "^4.0.7"
},

2
package.json

@ -78,7 +78,7 @@
"short-uuid": "^3.1.1",
"sjcl": "^1.0.8",
"socket.io": "^2.3.0",
"sphinx-bot": "^0.1.1",
"sphinx-bot": "^0.1.2",
"tail": "^2.0.3",
"ts-node": "^8.5.4",
"tsc": "^1.20150623.0",

Loading…
Cancel
Save