Browse Source

Merge pull request #78 from stakwork/botz2

Botz2
push-params
Evan Feenstra 4 years ago
committed by GitHub
parent
commit
abfd5cbbeb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      api/builtin/mother.ts
  2. 2
      api/builtin/welcome.ts
  3. 26
      api/network/intercept.ts
  4. 2
      api/network/receive.ts
  5. 2
      api/network/send.ts
  6. 2
      dist/api/builtin/mother.js
  7. 2
      dist/api/builtin/mother.js.map
  8. 2
      dist/api/builtin/welcome.js
  9. 2
      dist/api/builtin/welcome.js.map
  10. 27
      dist/api/network/intercept.js
  11. 2
      dist/api/network/intercept.js.map
  12. 2
      dist/api/network/receive.js
  13. 2
      dist/api/network/receive.js.map
  14. 2
      dist/api/network/send.js
  15. 2
      dist/api/network/send.js.map

2
api/builtin/mother.ts

@ -35,7 +35,7 @@ export function init() {
client.login('_', finalAction)
client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => {
const arr = message.content.split(' ')
const arr = (message.content && message.content.split(' ')) || []
if (arr.length < 2) return
if (arr[0]!=='/bot') return
const cmd = arr[1]

2
api/builtin/welcome.ts

@ -16,7 +16,7 @@ export function init() {
client.login('_', finalAction)
client.on(msg_types.MESSAGE, async (message: Sphinx.Message) => {
const arr = message.content.split(' ')
const arr = (message.content && message.content.split(' ')) || []
console.log('message.type',message.type)
const isGroupJoin = message.type===constants.message_types.group_join
if (arr.length < 2 && !isGroupJoin) return

26
api/network/intercept.ts

@ -15,7 +15,6 @@ restrictions (be able to toggle, or dont show chat)
// return bool whether to skip forwarding to tribe
export async function isBotMsg(msg:Msg, sentByMe:boolean): Promise<boolean> {
const txt = msg.message&&msg.message.content
if(!txt) return false
const msgType = msg.type
if(msgType===constants.message_types.bot_res) {
@ -28,7 +27,7 @@ export async function isBotMsg(msg:Msg, sentByMe:boolean): Promise<boolean> {
let didEmit = false
if(txt.startsWith('/bot ')) {
if(txt && txt.startsWith('/bot ')) {
builtinBotEmit(msg)
didEmit = true
}
@ -37,19 +36,26 @@ export async function isBotMsg(msg:Msg, sentByMe:boolean): Promise<boolean> {
const botsInTribe = await models.ChatBot.findAll({where:{
chatId: chat.id
}})
// console.log('=> botsInTribe', botsInTribe)
if(!(botsInTribe && botsInTribe.length)) return false
await asyncForEach(botsInTribe, async botInTribe=>{
if(txt && txt.startsWith(`${botInTribe.botPrefix} `)) {
if(botInTribe.msgTypes){
try {
const msgTypes = JSON.parse(botInTribe.msgTypes)
if(msgTypes.includes(msgType)){
if(botInTribe.msgTypes){
// console.log('=> botInTribe.msgTypes', botInTribe)
try {
const msgTypes = JSON.parse(botInTribe.msgTypes)
if(msgTypes.includes(msgType)){
const isMsgAndHasText = msgType===constants.message_types.message && txt && txt.startsWith(`${botInTribe.botPrefix} `)
const isNotMsg = msgType!==constants.message_types.message
if(isMsgAndHasText || isNotMsg) {
didEmit = await emitMessageToBot(msg, botInTribe.dataValues)
}
} catch(e){}
} else { // no message types defined, do all?
}
} catch(e){}
} else { // no message types defined, do all?
if(txt && txt.startsWith(`${botInTribe.botPrefix} `)) {
// console.log('=> botInTribe.msgTypes else', botInTribe.dataValues)
didEmit = await emitMessageToBot(msg, botInTribe.dataValues)
}
}
@ -59,7 +65,7 @@ export async function isBotMsg(msg:Msg, sentByMe:boolean): Promise<boolean> {
}
async function emitMessageToBot(msg, botInTribe): Promise<boolean> {
console.log('emitMessageToBot',msg)
// console.log('emitMessageToBot',msg)
switch (botInTribe.botType) {
case constants.bot_types.builtin:
builtinBotEmit(msg)

2
api/network/receive.ts

@ -44,7 +44,7 @@ const botMakerTypes=[
constants.message_types.bot_cmd,
]
async function onReceive(payload){
console.log('===> onReceive',JSON.stringify(payload,null,2))
// console.log('===> onReceive',JSON.stringify(payload,null,2))
if(!(payload.type||payload.type===0)) return console.log('no payload.type')
if(botTypes.includes(payload.type)) {

2
api/network/send.ts

@ -65,7 +65,7 @@ export async function sendMessage(params) {
let yes:any = true
let no:any = null
console.log('all contactIds',contactIds)
// console.log('=> all contactIds',contactIds)
await asyncForEach(contactIds, async contactId => {
if (contactId == 1) { // dont send to self
return

2
dist/api/builtin/mother.js

@ -39,7 +39,7 @@ function init() {
const client = new Sphinx.Client();
client.login('_', actions_1.finalAction);
client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () {
const arr = message.content.split(' ');
const arr = (message.content && message.content.split(' ')) || [];
if (arr.length < 2)
return;
if (arr[0] !== '/bot')

2
dist/api/builtin/mother.js.map

File diff suppressed because one or more lines are too long

2
dist/api/builtin/welcome.js

@ -23,7 +23,7 @@ function init() {
const client = new Sphinx.Client();
client.login('_', actions_1.finalAction);
client.on(msg_types.MESSAGE, (message) => __awaiter(this, void 0, void 0, function* () {
const arr = message.content.split(' ');
const arr = (message.content && message.content.split(' ')) || [];
console.log('message.type', message.type);
const isGroupJoin = message.type === constants.message_types.group_join;
if (arr.length < 2 && !isGroupJoin)

2
dist/api/builtin/welcome.js.map

@ -1 +1 @@
{"version":3,"file":"welcome.js","sourceRoot":"","sources":["../../../api/builtin/welcome.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAoC;AACpC,oDAAoD;AACpD,sCAAkC;AAClC,6BAA4B;AAC5B,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAA;AAEjC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,CAAA;AAE9E,IAAI,OAAO,GAAG,KAAK,CAAA;AAEnB,SAAgB,IAAI;IAClB,IAAG,OAAO;QAAE,OAAM;IAClB,OAAO,GAAG,IAAI,CAAA;IAEd,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAA;IAClC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,qBAAW,CAAC,CAAA;IAE9B,MAAM,CAAC,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAO,OAAuB,EAAE,EAAE;QAC7D,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CA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oBAgEC;AAED,MAAM,MAAM,GAAG;;OAER,CAAA"}

27
dist/api/network/intercept.js

@ -23,8 +23,6 @@ restrictions (be able to toggle, or dont show chat)
function isBotMsg(msg, sentByMe) {
return __awaiter(this, void 0, void 0, function* () {
const txt = msg.message && msg.message.content;
if (!txt)
return false;
const msgType = msg.type;
if (msgType === constants.message_types.bot_res) {
return false; // bot res msg type not for processing
@ -35,7 +33,7 @@ function isBotMsg(msg, sentByMe) {
if (!chat)
return false;
let didEmit = false;
if (txt.startsWith('/bot ')) {
if (txt && txt.startsWith('/bot ')) {
builtin_1.builtinBotEmit(msg);
didEmit = true;
}
@ -44,20 +42,27 @@ function isBotMsg(msg, sentByMe) {
const botsInTribe = yield models_1.models.ChatBot.findAll({ where: {
chatId: chat.id
} });
// console.log('=> botsInTribe', botsInTribe)
if (!(botsInTribe && botsInTribe.length))
return false;
yield asyncForEach(botsInTribe, (botInTribe) => __awaiter(this, void 0, void 0, function* () {
if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) {
if (botInTribe.msgTypes) {
try {
const msgTypes = JSON.parse(botInTribe.msgTypes);
if (msgTypes.includes(msgType)) {
if (botInTribe.msgTypes) {
// console.log('=> botInTribe.msgTypes', botInTribe)
try {
const msgTypes = JSON.parse(botInTribe.msgTypes);
if (msgTypes.includes(msgType)) {
const isMsgAndHasText = msgType === constants.message_types.message && txt && txt.startsWith(`${botInTribe.botPrefix} `);
const isNotMsg = msgType !== constants.message_types.message;
if (isMsgAndHasText || isNotMsg) {
didEmit = yield emitMessageToBot(msg, botInTribe.dataValues);
}
}
catch (e) { }
}
else { // no message types defined, do all?
catch (e) { }
}
else { // no message types defined, do all?
if (txt && txt.startsWith(`${botInTribe.botPrefix} `)) {
// console.log('=> botInTribe.msgTypes else', botInTribe.dataValues)
didEmit = yield emitMessageToBot(msg, botInTribe.dataValues);
}
}
@ -68,7 +73,7 @@ function isBotMsg(msg, sentByMe) {
exports.isBotMsg = isBotMsg;
function emitMessageToBot(msg, botInTribe) {
return __awaiter(this, void 0, void 0, function* () {
console.log('emitMessageToBot', msg);
// console.log('emitMessageToBot',msg)
switch (botInTribe.botType) {
case constants.bot_types.builtin:
builtin_1.builtinBotEmit(msg);

2
dist/api/network/intercept.js.map

@ -1 +1 @@
{"version":3,"file":"intercept.js","sourceRoot":"","sources":["../../../api/network/intercept.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,sCAAkC;AAClC,wCAAyC;AACzC,8CAAkE;AAClE,6BAA4B;AAC5B,wCAAuC;AAEvC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E;;;EAGE;AAEF,kDAAkD;AAClD,SAAsB,QAAQ,CAAC,GAAO,EAAE,QAAgB;;QACtD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,IAAE,GAAG,CAAC,OAAO,CAAC,OAAO,CAAA;QAC5C,IAAG,CAAC,GAAG;YAAE,OAAO,KAAK,CAAA;QAErB,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAA;QACxB,IAAG,OAAO,KAAG,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE;YAC5C,OAAO,KAAK,CAAA,CAAC,sCAAsC;SACpD;QACD,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBAC5C,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,IAAI;aACpB,EAAC,CAAC,CAAA;QACH,IAAG,CAAC,IAAI;YAAE,OAAO,KAAK,CAAA;QAEtB,IAAI,OAAO,GAAG,KAAK,CAAA;QAEnB,IAAG,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE;YAC1B,wBAAc,CAAC,GAAG,CAAC,CAAA;YACnB,OAAO,GAAG,IAAI,CAAA;SACf;QACD,IAAG,OAAO;YAAE,OAAO,OAAO,CAAA;QAE1B,MAAM,WAAW,GAAG,MAAM,eAAM,CAA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dist/api/network/receive.js

@ -53,7 +53,7 @@ const botMakerTypes = [
];
function onReceive(payload) {
return __awaiter(this, void 0, void 0, function* () {
console.log('===> onReceive', JSON.stringify(payload, null, 2));
// console.log('===> onReceive',JSON.stringify(payload,null,2))
if (!(payload.type || payload.type === 0))
return console.log('no payload.type');
if (botTypes.includes(payload.type)) {

2
dist/api/network/receive.js.map

File diff suppressed because one or more lines are too long

2
dist/api/network/send.js

@ -70,7 +70,7 @@ function sendMessage(params) {
}
let yes = true;
let no = null;
console.log('all contactIds', contactIds);
// console.log('=> all contactIds',contactIds)
yield asyncForEach(contactIds, (contactId) => __awaiter(this, void 0, void 0, function* () {
if (contactId == 1) { // dont send to self
return;

2
dist/api/network/send.js.map

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save