BotKit 0.2.0 released
BotKit 0.2.0 released
I did some debugging on my last instance move: 803 "mutual" accounts didn't respond to the move request (that is, their server/instance never ack the request) which as far as I understand how fedi works means they've moved or dropped out.
I tried manually opening a few and indeed they don't exist. If they had moved or self-destructed, it's strange that Mastodon didn't prune them - every little bit towards less storage use by Mastodon will help!
BotKit 0.2.0 ๋ฆด๋ฆฌ์ค
BotKit 0.2.0 ๋ฒ์ ์ด ๋ฆด๋ฆฌ์ค๋์์ต๋๋ค! BotKit์ ์ฒ์ ์ ํ์๋ ๋ถ๋ค์ ์ํด ๊ฐ๋จํ ์๊ฐํ์๋ฉด, BotKit์ TypeScript๋ก ๊ฐ๋ฐ๋ ๋ ๋ฆฝํ #ActivityPub ๋ด ํ๋ ์์ํฌ์ ๋๋ค. Mastodon, Misskey ๋ฑ ๋ค์ํ #์ฐํฉ์ฐ์ฃผ(#fediverse) ํ๋ซํผ๊ณผ ์ํธ์์ฉํ ์ ์์ผ๋ฉฐ, ๊ธฐ์กด ํ๋ซํผ์ ์ ์ฝ์์ ๋ฒ์ด๋ ์์ ๋กญ๊ฒ ๋ด์ ๋ง๋ค ์ ์์ต๋๋ค.
์ด๋ฒ ๋ฆด๋ฆฌ์ค๋ ์ฐํฉ์ฐ์ฃผ ๋ด ๊ฐ๋ฐ์ ๋ ์ฝ๊ณ ๊ฐ๋ ฅํ๊ฒ ๋ง๋ค๊ธฐ ์ํ ์ฌ์ ์์ ์ค์ํ ๋ฐ๊ฑธ์์ ๋๋ค. ์ปค๋ฎค๋ํฐ์์ ์์ฒญํด ์๋ ์ฌ๋ฌ ๊ธฐ๋ฅ๋ค์ ์๋กญ๊ฒ ์ ๋ณด์ ๋๋ค.
๋ ๋์ ๋ด ์ํธ์์ฉ์ ์ํ ์ฌ์
BotKit์ ๊ฐ๋ฐํ๋ฉด์ ์ฐ๋ฆฌ๋ ํญ์ ๋ด์ด ๋ ํํ๋ ฅ ์๊ณ ์ํธ์์ฉ์ด ํ๋ถํ๋๋ก ๋ง๋๋ ๋ฐ ์ง์คํด ์์ต๋๋ค. 0.2.0 ๋ฒ์ ์์๋ ์ฐํฉ์ฐ์ฃผ์ ์ฌํ์ ์ธก๋ฉด์ ๋ด์ ์ ๋ชฉ์์ผ ํ ๋จ๊ณ ๋ ๋ฐ์ ์์ผฐ์ต๋๋ค.
์ปค์คํ ์๋ชจ์ง๋ก ๋ด์ ๊ฐ์ฑ ํํํ๊ธฐ
๊ฐ์ฅ ๋ง์ด ์์ฒญ๋ฐ์๋ ๊ธฐ๋ฅ ์ค ํ๋๊ฐ #์ปค์คํ _์๋ชจ์ง ์ง์์ ๋๋ค. ์ด์ ๋ด์ ๋ ํนํ ์๊ฐ์ ์์๋ก ๋ฉ์์ง๋ฅผ ๋๋ณด์ด๊ฒ ํ๋ฉฐ ์์ ๋ง์ ๊ฐ์ฑ์ ํํํ ์ ์์ต๋๋ค.
// ๋ด์ ์ปค์คํ
์๋ชจ์ง ์ ์ํ๊ธฐ
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"
}
});
// ๋ฉ์์ง์ ์ปค์คํ
์๋ชจ์ง ์ฌ์ฉํ๊ธฐ
await session.publish(
text`BotKit ${customEmoji(emojis.botkit)}์ Fedify ${customEmoji(emojis.fedify)}์ ์ง์์ ๋ฐ์ต๋๋ค`
);
์ด ์๋ก์ด API๋ฅผ ํตํด ๋ค์๊ณผ ๊ฐ์ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
Bot.addCustomEmojis()
๋ก ๋ด์ ์ปค์คํ
์๋ชจ์ง ์ถ๊ฐํ๊ธฐcustomEmoji()
ํจ์๋ก ๋ฉ์์ง์ ์๋ชจ์ง ํฌํจํ๊ธฐEmoji
๊ฐ์ฒด๋ฅผ text
ํ๊ทธ ํ
ํ๋ฆฟ์์ ์ฌ์ฉํ๊ธฐ๋ฐ์์ ํตํ ์ํต
์ํต์ ๋จ์ํ ๋ฉ์์ง๋ฅผ ๊ฒ์ํ๋ ๊ฒ๋ง์ด ์๋๋๋ค. ๋ค๋ฅธ ์ฌ๋์ ๋ฉ์์ง์ ๋ฐ์ํ๋ ๊ฒ๋ ์ค์ํฉ๋๋ค. ์๋ก์ด ๋ฐ์ ์์คํ ์ ๋ด๊ณผ ํ๋ก์ ์ฌ์ด์ ์์ฐ์ค๋ฌ์ด ์ํธ์์ฉ ์ง์ ์ ๋ง๋ค์ด ์ค๋๋ค.
// ํ์ค ์ ๋์ฝ๋ ์๋ชจ์ง๋ก ๋ฉ์์ง์ ๋ฐ์ํ๊ธฐ
await message.react(emoji`๐`);
// ๋๋ ์ ์ํ ์ปค์คํ
์๋ชจ์ง๋ก ๋ฐ์ํ๊ธฐ
await message.react(emojis.botkit);
// ๋ฐ์์ ์ธ์ํ๊ณ ์๋ตํ๋ ๋ด ๋ง๋ค๊ธฐ
bot.onReact = async (session, reaction) => {
await session.publish(
text`${reaction.actor}๋, ์ ๋ฉ์์ง์ ${reaction.emoji} ๋ฐ์์ ๋จ๊ฒจ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค!`,
{ visibility: "direct" }
);
};
์ด ๊ธฐ๋ฅ์ ํตํด ๋ด์ ๋ค์๊ณผ ๊ฐ์ ์์ ์ ์ํํ ์ ์์ต๋๋ค.
Message.react()
๋ฅผ ์ฌ์ฉํ์ฌ ์ ๋์ฝ๋ ์๋ชจ์ง๋ก ๋ฉ์์ง์ ๋ฐ์ํ๊ธฐBot.onReact
์ Bot.onUnreact
ํธ๋ค๋ฌ๋ก ๋ฐ์ ์ด๋ฒคํธ ์ฒ๋ฆฌํ๊ธฐ์ธ์ฉ์ ํตํ ๋ํ
ํ ๋ก ์์๋ ์ข ์ข ๋ค๋ฅธ ์ฌ๋์ด ๋งํ ๋ด์ฉ์ ์ฐธ์กฐํด์ผ ํ ๋๊ฐ ์์ต๋๋ค. ์๋ก์ด #์ธ์ฉ ๊ธฐ๋ฅ์ ๋ ์์ง๋ ฅ ์๋ ๋ํ ์ค๋ ๋๋ฅผ ๋ง๋ค์ด ์ค๋๋ค.
// ๋ด์ ๊ฒ์๋ฌผ์์ ๋ค๋ฅธ ๋ฉ์์ง ์ธ์ฉํ๊ธฐ
await session.publish(
text`์ด ํฅ๋ฏธ๋ก์ด ๊ด์ ์ ๋ํ ๋ต๋ณ์
๋๋ค...`,
{ quoteTarget: originalMessage }
);
// ์ฌ์ฉ์๊ฐ ๋ด์ ๋ฉ์์ง๋ฅผ ์ธ์ฉํ ๋ ์ฒ๋ฆฌํ๊ธฐ
bot.onQuote = async (session, quoteMessage) => {
await session.publish(
text`${quoteMessage.actor}๋, ์ ์๊ฐ์ ๊ณต์ ํด ์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค!`,
{ visibility: "direct" }
);
};
์ธ์ฉ ๊ธฐ๋ฅ์ ํตํด ๋ด์ ๋ค์๊ณผ ๊ฐ์ ์์ ์ ์ํํ ์ ์์ต๋๋ค.
quoteTarget
์ต์
์ผ๋ก ๋ฉ์์ง ์ธ์ฉํ๊ธฐMessage.quoteTarget
์ ํตํด ์ธ์ฉ๋ ๋ฉ์์ง์ ์ ๊ทผํ๊ธฐBot.onQuote
์ด๋ฒคํธ ํธ๋ค๋ฌ๋ก ์ธ์ฉ ์ด๋ฒคํธ ์ฒ๋ฆฌํ๊ธฐ์๊ฐ์ ๊ฐ์
์ํต์ ์๊ฐ์ ์ธ ์์๋ ์ค์ํ๊ธฐ ๋๋ฌธ์ ๋ด์ ํํ ๋ฐฉ์์ ๊ฐ์ ํ์ต๋๋ค.
๋ด๋ถ ๊ฐ์ : ํฅ์๋ ์กํฐ๋นํฐ ์ ํ
์ฐํฉ์ฐ์ฃผ์์ ์กํฐ๋นํฐ๊ฐ ์ ํ๋๋ ๋ฐฉ์๋ ๊ฐ์ ํ์ต๋๋ค.
์ด๋ฌํ ๊ฐ์ ์ฌํญ์ ๋ค์ํ ์ฐํฉ์ฐ์ฃผ ํ๋ซํผ์์ ๋ด์ ์ํธ์์ฉ์ด ์ผ๊ด๋๊ณ ์์ ์ ์ผ๋ก ์ด๋ฃจ์ด์ง๋๋ก ๋ณด์ฅํฉ๋๋ค.
BotKit 0.2.0์ผ๋ก ์ฒซ ๊ฑธ์ ๋ผ๊ธฐ
์ด๋ฌํ ์๋ก์ด ๊ธฐ๋ฅ์ ๊ฒฝํํด ๋ณด๊ณ ์ถ์ผ์ ๊ฐ์? BotKit 0.2.0์ JSR์์ ๋ฐ์ ์ ์์ผ๋ฉฐ ๊ฐ๋จํ ๋ช ๋ น์ด๋ก ์ค์นํ ์ ์์ต๋๋ค.
deno add jsr:@fedify/botkit@0.2.0
BotKit์ Temporal API(JavaScript์์ ์์ง ์๋ฒ์ ์ธ ๊ธฐ๋ฅ)๋ฅผ ์ฌ์ฉํ๋ฏ๋ก deno.json์์ ์ด๋ฅผ ํ์ฑํํด์ผ ํฉ๋๋ค.
{
"imports": {
"@fedify/botkit": "jsr:@fedify/botkit@0.2.0"
},
"unstable": ["temporal"]
}
์ด ๊ฐ๋จํ ๋จ๊ณ๋ฅผ ํตํด ์ต์ ๊ธฐ๋ฅ์ผ๋ก ์ฐํฉ์ฐ์ฃผ ๋ด์ ๋ง๋ค๊ฑฐ๋ ์ ๊ทธ๋ ์ด๋ํ ์ค๋น๊ฐ ์๋ฃ๋์์ต๋๋ค.
์์ผ๋ก์ ์ ๋ง
BotKit 0.2.0์ ์ฐํฉ์ฐ์ฃผ ๋ด ๊ฐ๋ฐ์ ์ ๊ทผํ๊ธฐ ์ฝ๊ณ , ๊ฐ๋ ฅํ๋ฉฐ, ์ฆ๊ฒ๊ฒ ๋ง๋ค๊ธฐ ์ํ ์ฐ๋ฆฌ์ ์ง์์ ์ธ ๋ ธ๋ ฅ์ ๋ณด์ฌ์ค๋๋ค. ์ด๋ฌํ ์๋ก์ด ๊ธฐ๋ฅ๋ค์ด ์ฌ๋ฌ๋ถ์ ๋ด์ด ์ฐํฉ์ฐ์ฃผ ์ปค๋ฎค๋ํฐ์์ ๋ ๋งค๋ ฅ์ ์ด๊ณ ์ํธ์์ฉ์ด ํ๋ถํ ๊ตฌ์ฑ์์ด ๋๋ ๋ฐ ๋์์ด ๋ ๊ฒ์ด๋ผ๊ณ ๋ฏฟ์ต๋๋ค.
์ ์ฒด ๋ฌธ์์ ๋ ๋ง์ ์์ ๋ ์ ํฌ ๋ฌธ์ ์ฌ์ดํธ์์ ํ์ธํ์ค ์ ์์ต๋๋ค.
ํผ๋๋ฐฑ, ๊ธฐ๋ฅ ์์ฒญ, ์ฝ๋ ๊ธฐ์ฌ๋ฅผ ํตํด ์ด๋ฒ ๋ฆด๋ฆฌ์ค์ ๋์์ ์ฃผ์ ๋ชจ๋ ๋ถ๋ค๊ป ๊ฐ์ฌ๋๋ฆฝ๋๋ค. BotKit ์ปค๋ฎค๋ํฐ๋ ๊ณ์ ์ฑ์ฅํ๊ณ ์์ผ๋ฉฐ, ์ฌ๋ฌ๋ถ์ด ๋ง๋ค์ด๋ผ ์ํ๋ค์ ๊ธฐ๋ํฉ๋๋ค!
BotKit์ ActivityPub ์๋ฒ ์ ํ๋ฆฌ์ผ์ด์ ์ ๋ง๋ค๊ธฐ ์ํ ํ์ ๋ ๋ฒจ ํ๋ ์์ํฌ์ธ Fedify์ ์ง์์ ๋ฐ์ต๋๋ค.
#fedidev #์ปค๋ชจ์ง #์ปค์คํ _์ด๋ชจ์ง #์๋ชจ์ง_๋ฐ์ #์ด๋ชจ์ง_๋ฐ์ #์๋ชจ์ง_๋ฆฌ์ก์ #์ด๋ชจ์ง_๋ฆฌ์ก์
BotKit 0.2.0 Released
We're pleased to announce the release of BotKit 0.2.0! For those new to our project, #BotKit is a #TypeScript framework for creating standalone #ActivityPub bots that can interact with Mastodon, Misskey, and other #fediverse platforms without the constraints of these existing platforms.
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.
The Journey to Better Bot Interactions
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.
Expressing Your Bot's Personality with Custom Emojis
One of the most requested features has been #custom_emoji support. Now your bots can truly express their personality with unique visuals that make their messages stand out.
// 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)}`
);
With this new API, you can:
Bot.addCustomEmojis()
customEmoji()
functiontext
tagged template with Fedify Emoji
objectsEngaging Through Reactions
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:
// 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" }
);
};
This feature allows your bot to:
Message.react()
Bot.onReact
and Bot.onUnreact
handlersConversations Through Quotes
Discussions often involve referencing what others have said. Our new #quote support enables more cohesive conversation threads:
// 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" }
);
};
With quote support, your bot can:
quoteTarget
optionMessage.quoteTarget
Bot.onQuote
event handlerVisual Enhancements
Because communication is visual too, we've improved how your bot presents itself:
Behind the Scenes: Enhanced Activity Propagation
We've also improved how activities propagate through the fediverse:
These improvements ensure your bot's interactions are consistent and reliable across different fediverse platforms.
Taking Your First Steps with BotKit 0.2.0
Ready to experience these new features? BotKit 0.2.0 is available on JSR and can be installed with a simple command:
deno add jsr:@fedify/botkit@0.2.0
Since BotKit uses the Temporal API (which is still evolving in JavaScript), remember to enable it in your deno.json:
{
"imports": {
"@fedify/botkit": "jsr:@fedify/botkit@0.2.0"
},
"unstable": ["temporal"]
}
With these simple steps, you're ready to create or upgrade your fediverse bot with our latest features.
Looking Forward
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.
For complete docs and more examples, visit our docs site.
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!
BotKit is powered by Fedify, a lower-level framework for creating ActivityPub server applications.
#Fread 1.3.1 has been released, the release note is as follows:
1. Now supports mirror URLs๐๐๐.
2. Interaction experience has been optimized.
3. A few bugs have been fixed.
#Mastodon #Bluesky #rss #activitypub #fediverse
https://play.google.com/store/apps/details?id=com.zhangke.fread
Coming soon in #BotKit 0.2.0: Native #quote post support!
We're excited to share a preview of the upcoming quoting features in BotKit 0.2.0. This update will make it easier for your bots to engage with quoted content across the fediverse.
The quoting feature set includes:
Bot.onQuote
event handlerMessage.quoteTarget
propertyquoteTarget
option in Session.publish()
and Message.reply()
methodsHere's a quick example of how you can use the quote detection:
bot.onQuote = async (session, quote) => {
// The quote parameter is a Message object representing the post that quoted your bot
await quote.reply(text`Thanks for quoting my post, ${quote.actor}!`);
// You can access the original quoted message
const originalPost = quote.quoteTarget;
console.log(`Original message: ${originalPost?.text}`);
};
And creating quote posts is just as simple:
// Quote in a new post
await session.publish(
text`I'm quoting this interesting message!`,
{ quoteTarget: someMessage }
);
// Or quote in a reply
await message.reply(
text`Interesting point! I'm quoting another relevant post here.`,
{ quoteTarget: anotherMessage }
);
Remember that quoting behavior may vary across different #ActivityPub implementationsโsome platforms like Misskey display quotes prominently, while others like Mastodon might implement them differently.
Want to try these features right now? You can install the development version from JSR:
deno add jsr:@fedify/botkit@0.2.0-dev.90+d6ab4bdc
We're looking forward to seeing how you use these quoting capabilities in your bots!