Created
December 1, 2020 09:03
-
-
Save arj03/ff2afea64fe87d05a01a5160a9cd6423 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tribes = require("ssb-tribes") | |
const Bot = require("scuttle-testbot") | |
const Stack = Bot.use(require("ssb-backlinks")).use(tribes) | |
const bot = Stack() | |
const Stack2 = Bot.use(require("ssb-backlinks")).use(tribes) | |
const bot2 = Stack2() | |
bot.tribes.create({}, (err, data) => { | |
const groupId = data.groupId | |
console.log(data) // groupKey | |
// publishes a msg | |
bot.tribes.invite(groupId, [bot2.id], {}, (err, msg) => { | |
console.log("invite", msg) | |
bot.get({id:msg.key, private: true}, (err, decrypted) => { | |
console.log(decrypted.content) | |
}) | |
bot.close() | |
}) | |
return | |
bot.publish({type: 'test', content: "a test message", recps: [groupId]}, (err, msg) => { | |
console.log(msg) | |
bot.get({id:msg.key, private: true}, (err, decrypted) => { | |
console.log(decrypted) | |
}) | |
bot.close() | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment