Browse Source

installBotAsTribeAdmin

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

4
api/builtin/mother.ts

@ -1,7 +1,7 @@
// import * as SphinxBot from '../../../sphinx-bot'
import * as Sphinx from 'sphinx-bot'
import { finalAction } from '../controllers/actions'
import { installBot } from '../controllers/bots'
import { installBotAsTribeAdmin } from '../controllers/bots'
import * as path from 'path'
import * as WelcomeBot from './welcome'
import * as LoopBot from './loop'
@ -96,7 +96,7 @@ export function init() {
}
})
if (!chat) return
installBot(chat.dataValues, bot)
installBotAsTribeAdmin(chat.dataValues, bot)
} else {
const embed = new Sphinx.MessageEmbed()
.setAuthor('MotherBot')

2
api/controllers/bots.ts

@ -67,7 +67,7 @@ export const deleteBot = async (req, res) => {
}
}
export async function installBot(chat, bot_json) {
export async function installBotAsTribeAdmin(chat, bot_json) {
const chatId = chat && chat.id
const chat_uuid = chat && chat.uuid
if(!chatId || !chat_uuid) return console.log('no chat id in installBot')

2
dist/api/builtin/mother.js

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

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

File diff suppressed because one or more lines are too long

4
dist/api/controllers/bots.js

@ -75,7 +75,7 @@ exports.deleteBot = (req, res) => __awaiter(void 0, void 0, void 0, function* ()
res_1.failure(res, e);
}
});
function installBot(chat, bot_json) {
function installBotAsTribeAdmin(chat, bot_json) {
return __awaiter(this, void 0, void 0, function* () {
const chatId = chat && chat.id;
const chat_uuid = chat && chat.uuid;
@ -134,7 +134,7 @@ function installBot(chat, bot_json) {
}
});
}
exports.installBot = installBot;
exports.installBotAsTribeAdmin = installBotAsTribeAdmin;
function keysendBotInstall(b, chat_uuid) {
return __awaiter(this, void 0, void 0, function* () {
return yield botKeysend(constants.message_types.bot_install, b.botUuid, b.botMakerPubkey, b.pricePerUse, chat_uuid);

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

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