Browse Source

cleanup

push-params
Evan Feenstra 4 years ago
parent
commit
3908227378
  1. 2
      api/builtin/mother.ts
  2. 2
      api/controllers/actions.ts
  3. 2
      api/controllers/bots.ts
  4. 2
      dist/api/builtin/mother.js
  5. 2
      dist/api/builtin/mother.js.map
  6. 2
      dist/api/controllers/actions.js
  7. 2
      dist/api/controllers/actions.js.map
  8. 2
      dist/api/controllers/bots.js
  9. 2
      dist/api/controllers/bots.js.map

2
api/builtin/mother.ts

@ -85,7 +85,7 @@ export function init() {
} else {
const bot = await getBotByName(botName)
if(bot && bot.uuid) {
console.log('=> FOUDN BOT', bot)
console.log('=> FOUND BOT', bot.unique_name)
const chat = await models.Chat.findOne({where:{
uuid: message.channel.id
}})

2
api/controllers/actions.ts

@ -70,7 +70,7 @@ export async function finalAction(a:Action, bot_id:string){
let theChat = await models.Chat.findOne({ where: { uuid: chat_uuid } })
const iAmTribeAdmin = owner.publicKey === (theChat && theChat.ownerPubkey)
console.log("=> ACTION HIT", a)
console.log("=> ACTION HIT", a.action, a.bot_name)
if(!iAmTribeAdmin) { // IM NOT ADMIN - its my bot and i need to forward to admin
const myBot = await models.Bot.findOne({where:{
id: bot_id

2
api/controllers/bots.ts

@ -72,7 +72,7 @@ export async function installBot(chat, bot_json) {
const chat_uuid = chat && chat.uuid
if(!chatId || !chat_uuid) return console.log('no chat id in installBot')
console.log("=> chat to install bot into", chat)
console.log("=> chat to install bot into", chat.name)
const owner = await models.Contact.findOne({ where: { isOwner: true } })
const isTribeOwner = (owner && owner.publicKey) === (chat && chat.ownerPubkey)
if(!isTribeOwner) return console.log('=> only tribe owner can install bots')

2
dist/api/builtin/mother.js

@ -92,7 +92,7 @@ function init() {
else {
const bot = yield getBotByName(botName);
if (bot && bot.uuid) {
console.log('=> FOUDN BOT', bot);
console.log('=> FOUND BOT', bot.unique_name);
const chat = yield models_1.models.Chat.findOne({ where: {
uuid: message.channel.id
} });

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

File diff suppressed because one or more lines are too long

2
dist/api/controllers/actions.js

@ -71,7 +71,7 @@ function finalAction(a, bot_id) {
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });
let theChat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } });
const iAmTribeAdmin = owner.publicKey === (theChat && theChat.ownerPubkey);
console.log("=> ACTION HIT", a);
console.log("=> ACTION HIT", a.action, a.bot_name);
if (!iAmTribeAdmin) { // IM NOT ADMIN - its my bot and i need to forward to admin
const myBot = yield models_1.models.Bot.findOne({ where: {
id: bot_id

2
dist/api/controllers/actions.js.map

File diff suppressed because one or more lines are too long

2
dist/api/controllers/bots.js

@ -81,7 +81,7 @@ function installBot(chat, bot_json) {
const chat_uuid = chat && chat.uuid;
if (!chatId || !chat_uuid)
return console.log('no chat id in installBot');
console.log("=> chat to install bot into", chat);
console.log("=> chat to install bot into", chat.name);
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });
const isTribeOwner = (owner && owner.publicKey) === (chat && chat.ownerPubkey);
if (!isTribeOwner)

2
dist/api/controllers/bots.js.map

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