A work-in-progress chat bot for Streamplace with chat overlay functionality
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

No more facets in custom shoutout records either

+6 -4
+3 -1
utils/commands/defaultCommands.ts
··· 5 5 import { FOLLOWER_MODE } from "../../env.ts"; 6 6 import { AppBskyRichtextFacet } from "@atcute/bluesky"; 7 7 import { is } from "@atcute/lexicons"; 8 + import { buildRichtext } from "../richtextUtils.ts"; 8 9 9 10 const commandsCommand: CommandWrapper = async (_message, _params, bot) => { 10 11 const commandsList = Array.from(bot.getCommands().keys()) ··· 57 58 } 58 59 59 60 if (customShoutout) { 60 - await bot.sendMessage(customShoutout.text, customShoutout.facets); 61 + const { text, facets } = await buildRichtext(customShoutout.text); 62 + await bot.sendMessage(text, facets); 61 63 } else if (receiverDid && receiverProfile) { 62 64 const { text, facets } = new RichtextBuilder() 63 65 .addMention(senderProfile.handle, event.did)
+3 -3
utils/streamplaceBot.ts
··· 12 12 PlaceStreamChatMessage, 13 13 PlaceStreamRichtextFacet, 14 14 } from "./lexicons/index.ts"; 15 + import { buildRichtext } from "./richtextUtils.ts"; 15 16 16 17 // Shoutout record from the repository 17 18 interface ShoutoutRecord { 18 19 user: Did; 19 20 text: string; 20 - facets?: Facet[]; 21 21 } 22 22 23 23 class StreamplaceBot { ··· 119 119 this.shoutouts.set(userDid, { 120 120 user: userDid, 121 121 text: record.value.text as string, 122 - facets: record.value.facets as Facet[], 123 122 }); 124 123 125 124 // Also resolve and cache shoutoutees ··· 155 154 if (this.shoutouts.get(event.did)) { 156 155 const shoutout = this.shoutouts.get(event.did); 157 156 if (shoutout) { 158 - await this.sendMessage(shoutout.text, shoutout.facets); 157 + const { text, facets } = await buildRichtext(shoutout.text); 158 + await this.sendMessage(text, facets); 159 159 } 160 160 } 161 161 }