Browse Source

log

push-params
Evan Feenstra 4 years ago
parent
commit
943ef33524
  1. 2
      api/bots/mother.ts
  2. 3
      api/controllers/bots.ts
  3. 2
      dist/api/bots/mother.js
  4. 2
      dist/api/bots/mother.js.map
  5. 3
      dist/api/controllers/bots.js
  6. 2
      dist/api/controllers/bots.js.map

2
api/bots/mother.ts

@ -90,7 +90,7 @@ export function init() {
uuid: message.channel.id
}})
if(!chat) return
installBot(chat, bot)
installBot(chat.dataValues, bot)
} else {
const embed = new Sphinx.MessageEmbed()
.setAuthor('MotherBot')

3
api/controllers/bots.ts

@ -70,9 +70,10 @@ 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)
const owner = await models.Contact.findOne({ where: { isOwner: true } })
const isTribeOwner = owner && owner.publicKey && owner.publicKey === chat && chat.ownerPubkey
if(!isTribeOwner) return console.log('only tribe owner can install bots')
if(!isTribeOwner) return console.log('=> only tribe owner can install bots')
const {uuid,owner_pubkey,unique_name,price_per_use} = bot_json
const chatBot = {

2
dist/api/bots/mother.js

@ -98,7 +98,7 @@ function init() {
} });
if (!chat)
return;
bots_1.installBot(chat, bot);
bots_1.installBot(chat.dataValues, bot);
}
else {
const embed = new Sphinx.MessageEmbed()

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

File diff suppressed because one or more lines are too long

3
dist/api/controllers/bots.js

@ -80,10 +80,11 @@ 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);
const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } });
const isTribeOwner = owner && owner.publicKey && owner.publicKey === chat && chat.ownerPubkey;
if (!isTribeOwner)
return console.log('only tribe owner can install bots');
return console.log('=> only tribe owner can install bots');
const { uuid, owner_pubkey, unique_name, price_per_use } = bot_json;
const chatBot = {
chatId,

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

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