BotKit by Fedify :botkit:<p><strong>BotKit 0.2.0 Released</strong></p><p>We're pleased to announce the release of <a href="https://botkit.fedify.dev/" rel="nofollow noopener noreferrer" target="_blank">BotKit</a> 0.2.0! For those new to our project, <a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/BotKit" target="_blank">#<span>BotKit</span></a> is a <a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/TypeScript" target="_blank">#<span>TypeScript</span></a> framework for creating standalone <a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/ActivityPub" target="_blank">#<span>ActivityPub</span></a> bots that can interact with Mastodon, Misskey, and other <a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/fediverse" target="_blank">#<span>fediverse</span></a> platforms without the constraints of these existing platforms.</p><p>This release marks an important step in our journey to make fediverse bot development more accessible and powerful, introducing several features that our community has been requesting.</p><p><strong>The Journey to Better Bot Interactions</strong></p><p>In building BotKit, we've always focused on making bots more expressive and interactive. With version 0.2.0, we're taking this to the next level by bringing the social aspects of the fediverse to your bots.</p><p><strong>Expressing Your Bot's Personality with Custom Emojis</strong></p><p>One of the most requested features has been <a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/custom_emoji" target="_blank">#<span>custom_emoji</span></a> support. Now your bots can truly express their personality with unique visuals that make their messages stand out.</p><pre><code>// Define custom emojis for your bot
const emojis = bot.addCustomEmojis({
botkit: {
file: `${import.meta.dirname}/images/botkit.png`,
type: "image/png"
},
fedify: {
url: "https://fedify.dev/logo.png",
type: "image/png"
}
});
// Use these custom emojis in your messages
await session.publish(
text`BotKit ${customEmoji(emojis.botkit)} is powered by Fedify ${customEmoji(emojis.fedify)}`
);
</code></pre><p>With this new API, you can:</p><ul>
<li>Add custom emojis to your bot with <code>Bot.addCustomEmojis()</code></li><li>Include these emojis in messages with the <a href="https://botkit.fedify.dev/concepts/text#custom-emojis" rel="nofollow noopener noreferrer" target="_blank"><code>customEmoji()</code></a> function</li><li><a href="https://botkit.fedify.dev/concepts/text#emoji" rel="nofollow noopener noreferrer" target="_blank">Use the <code>text</code> tagged template with Fedify <code>Emoji</code> objects</a></li>
</ul><p><strong>Engaging Through Reactions</strong></p><p>Communication isn't just about posting messages—it's also about responding to others. The new reaction system creates natural interaction points between your bot and its followers:</p><pre><code>// React to a message with a standard Unicode emoji
await message.react(emoji`👍`);
// Or use one of your custom emojis as a reaction
await message.react(emojis.botkit);
// Create a responsive bot that acknowledges reactions
bot.onReact = async (session, reaction) => {
await session.publish(
text`Thanks for reacting with ${reaction.emoji} to my message, ${reaction.actor}!`,
{ visibility: "direct" }
);
};
</code></pre><p>This feature allows your bot to:</p><ul>
<li>React to messages with Unicode emojis using <a href="https://botkit.fedify.dev/concepts/message#reacting-to-a-message-with-an-emoji" rel="nofollow noopener noreferrer" target="_blank"><code>Message.react()</code></a></li><li>React with the custom emojis you've defined</li><li>Handle reaction events with <a href="https://botkit.fedify.dev/concepts/events#emoji-reaction" rel="nofollow noopener noreferrer" target="_blank"><code>Bot.onReact</code></a> and <a href="https://botkit.fedify.dev/concepts/events#undoing-emoji-reaction" rel="nofollow noopener noreferrer" target="_blank"><code>Bot.onUnreact</code></a> handlers</li>
</ul><p><strong>Conversations Through Quotes</strong></p><p>Discussions often involve referencing what others have said. Our new <a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/quote" target="_blank">#<span>quote</span></a> support enables more cohesive conversation threads:</p><pre><code>// Quote another message in your bot's post
await session.publish(
text`Responding to this interesting point...`,
{ quoteTarget: originalMessage }
);
// Handle when users quote your bot's messages
bot.onQuote = async (session, quoteMessage) => {
await session.publish(
text`Thanks for sharing my thoughts, ${quoteMessage.actor}!`,
{ visibility: "direct" }
);
};
</code></pre><p>With quote support, your bot can:</p><ul>
<li>Quote messages with <a href="https://botkit.fedify.dev/concepts/message#quoting" rel="nofollow noopener noreferrer" target="_blank"><code>quoteTarget</code></a> option</li><li>Access quoted messages via <a href="https://botkit.fedify.dev/concepts/message#quotes" rel="nofollow noopener noreferrer" target="_blank"><code>Message.quoteTarget</code></a></li><li>Handle quote events with the new <a href="https://botkit.fedify.dev/concepts/events#quote" rel="nofollow noopener noreferrer" target="_blank"><code>Bot.onQuote</code></a> event handler</li>
</ul><p><strong>Visual Enhancements</strong></p><p>Because communication is visual too, we've improved how your bot presents itself:</p><ul>
<li>Image attachments now properly display in the web interface</li><li>Your bot's content looks better and provides a richer experience</li>
</ul><p><strong>Behind the Scenes: Enhanced Activity Propagation</strong></p><p>We've also improved how activities propagate through the fediverse:</p><ul>
<li>More precise propagation of replies, shares, updates, and deletes</li><li>Activities are now properly sent to the original message authors</li>
</ul><p>These improvements ensure your bot's interactions are consistent and reliable across different fediverse platforms.</p><p><strong>Taking Your First Steps with BotKit 0.2.0</strong></p><p>Ready to experience these new features? BotKit 0.2.0 is available on <a href="https://jsr.io/@fedify/botkit@0.2.0" rel="nofollow noopener noreferrer" target="_blank">JSR</a> and can be installed with a simple command:</p><pre><code>deno add jsr:@fedify/botkit@0.2.0
</code></pre><p>Since BotKit uses the Temporal API (which is still evolving in JavaScript), remember to enable it in your <em>deno.json</em>:</p><pre><code>{
"imports": {
"@fedify/botkit": "jsr:@fedify/botkit@0.2.0"
},
"unstable": ["temporal"]
}
</code></pre><p>With these simple steps, you're ready to create or upgrade your fediverse bot with our latest features.</p><p><strong>Looking Forward</strong></p><p>BotKit 0.2.0 represents our ongoing commitment to making fediverse bot development accessible, powerful, and enjoyable. We believe these new features will help your bots become more engaging and interactive members of the fediverse community.</p><p>For complete docs and more examples, visit our <a href="https://botkit.fedify.dev/" rel="nofollow noopener noreferrer" target="_blank">docs site</a>.</p><p>Thank you to everyone who contributed to this release through feedback, feature requests, and code contributions. The BotKit community continues to grow, and we're excited to see what you'll create!</p>
<p><em>BotKit is powered by <a href="https://fedify.dev/" rel="nofollow noopener noreferrer" target="_blank">Fedify</a>, a lower-level framework for creating ActivityPub server applications.</em></p><p><a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/fedidev" target="_blank">#<span>fedidev</span></a> <a class="mention hashtag" rel="nofollow noopener noreferrer" href="https://hollo.social/tags/emoji_reaction" target="_blank">#<span>emoji_reaction</span></a></p>