BotKit by Fedify :botkit:'s avatar

BotKit by Fedify :botkit:

@botkit@hollo.social · 3 following · 179 followers

:botkit: A framework for creating ActivityPub bots. Powered by :fedify: @fedify.

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

:botkit: Introducing : A framework for creating truly standalone bots!

Unlike traditional Mastodon bots, BotKit lets you build fully independent bots that aren't constrained by platform limits. Create your entire bot in a single TypeScript file using our simple, expressive API.

Currently -only, with Node.js & Bun support planned. Built on the robust @fedify foundation.

https://botkit.fedify.dev/

Nelson's avatar
Nelson

@skyfaller@jawns.club · Reply to Loren's post

@loren BotKit looks like an interesting approach, but I've never made a bot so I can't evaluate it: botkit.fedify.dev/

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social · Reply to Fedify: ActivityPub server framework's post

Fedifyの関連プロジェクトをご紹介したいと思います。ActivityPubアプリケーション開発をより簡単にするツール群です:

Fedify :fedify:

Fedify@fedify)はActivityPubやその他のフェディバース標準を活用する連合型サーバーアプリケーションを構築するためのTypeScriptライブラリです。Activity Vocabularyの型安全なオブジェクト、WebFingerクライアント・サーバー、HTTP Signaturesなどを提供し、ボイラープレートコードを削減してアプリケーションロジックに集中できるようにします。

Hollo :hollo:

Hollo@hollo)はFedifyで動作するお一人様用マイクロブログサーバーです。個人向けに設計されていますが、ActivityPubを通じて完全に連合化されており、フェディバース全体のユーザーと交流することができます。HolloはMastodon互換APIを実装しているため、独自のウェブインターフェースがなくても、ほとんどのMastodonクライアントと互換性があります。

Holloはまた、正式リリース前の最新Fedify機能をテストする実験場としても活用されています。

BotKit :botkit:

BotKit@botkit)は私たちの最も新しいメンバーで、ActivityPubボットを作成するために特別に設計されたフレームワークです。従来のMastodonボットとは異なり、BotKitはプラットフォーム固有の制限(文字数制限など)に縛られない独立したActivityPubサーバーを作成します。

BotKitのAPIは意図的にシンプルに設計されており、単一のTypeScriptファイルで完全なボットを作成できます!


これら三つのプロジェクトはすべて@fedify-dev GitHubオーガニゼーションでオープンソースとして公開されています。それぞれ異なる目的を持っていますが、ActivityPub開発をより身近にし、フェディバースのエコシステムを拡大するという共通の目標を共有しています。

これらのプロジェクトを試してみたり、開発に貢献したりすることに興味がある場合は、以下をご覧ください:

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social · Reply to Fedify: ActivityPub server framework's post

자매 프로젝트들을 소개해 드리고자 합니다. 애플리케이션 개발을 더 쉽게 만들어주는 관련 도구들입니다:

Fedify :fedify:

Fedify(@fedify)는 ActivityPub와 다른 () 표준을 기반으로 연합 서버 애플리케이션을 구축하기 위한 라이브러리입니다. Activity Vocabulary를 위한 타입 안전한 객체, WebFinger 클라이언트·서버, HTTP Signatures 등를 제공하여 반복적인 코드를 줄이고 애플리케이션 로직에 집중할 수 있게 해줍니다.

Hollo :hollo:

Hollo(@hollo)는 Fedify로 구동되는 1인 사용자용 마이크로블로깅 서버입니다. 1인 사용자를 위해 설계되었지만, ActivityPub를 통해 완전히 연합되어 연합우주 전체의 사용자들과 상호작용할 수 있습니다. Hollo는 Mastodon 호환 API를 구현하여 자체 웹 인터페이스 없이도 대부분의 Mastodon 클라이언트와 호환됩니다.

Hollo는 또한 정식 출시 전에 최신 Fedify 기능을 테스트하는 실험장으로도 활용되고 있습니다.

BotKit :botkit:

BotKit(@botkit)은 저희의 가장 새로운 구성원으로, ActivityPub 봇을 만들기 위해 특별히 설계된 프레임워크입니다. 전통적인 Mastodon 봇과 달리, BotKit은 플랫폼별 제한(글자 수 제한 등)에 구애받지 않는 독립적인 ActivityPub 서버를 만듭니다.

BotKit의 API는 의도적으로 단순하게 설계되어 단일 TypeScript 파일로 완전한 봇을 만들 수 있습니다!


세 프로젝트 모두 @fedify-dev GitHub 조직에서 오픈 소스로 공개되어 있습니다. 각기 다른 목적을 가지고 있지만, ActivityPub 개발을 더 접근하기 쉽게 만들고 연합우주 생태계를 확장한다는 공통된 목표를 공유합니다.

이러한 프로젝트를 사용해보거나 개발에 기여하는 데 관심이 있으시다면, 다음을 확인해보세요:

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

We'd like to introduce the project family—a set of related tools that make building applications more accessible:

Fedify :fedify:

Fedify (@fedify) is a library for building federated server applications powered by ActivityPub and other standards. It provides type-safe objects for Activity Vocabulary, WebFinger client/server, HTTP Signatures, and more—eliminating boilerplate code so you can focus on your application logic.

Hollo :hollo:

Hollo (@hollo) is a single-user microblogging server powered by Fedify. While designed for individual users, it's fully federated through ActivityPub, allowing interaction with users across the fediverse. implements Mastodon-compatible APIs, making it compatible with most Mastodon clients without needing its own web interface.

Hollo also serves as our testing ground for bleeding-edge Fedify features before they're officially released.

BotKit :botkit:

BotKit (@botkit) is our newest family member—a framework specifically designed for creating ActivityPub bots. Unlike traditional Mastodon bots, creates standalone ActivityPub servers that aren't constrained by platform-specific limitations (like character counts).

BotKit's API is intentionally simple—you can create a complete bot in a single TypeScript file!


All three projects are open source and hosted under the @fedify-dev GitHub organization. While they serve different purposes, they share common goals: making ActivityPub development more accessible and expanding the fediverse ecosystem.

If you're interested in trying any of these projects or contributing to their development, check out:

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

Are you interested in creating bots for the ? Meet , a framework that makes bot development easier than ever!

Key Features:

True Independence

  • Create standalone bots
  • No need for a Mastodon or Misskey account
  • Free from platform-specific limitations

Simple and Intuitive API

  • Create a complete bot in a single TypeScript file
  • Intuitive event handlers for mentions, follows, and messages
  • Rich text formatting with Markdown support

Modern Deployment

  • Deploy on Deno Deploy, Fly.io, Railway, or any virtual server
  • Minimal dependencies
  • Designed for modern cloud platforms

Enterprise-Ready Foundation

  • Built on Fedify, a rock-solid ActivityPub framework
  • Seamless federation with Mastodon, Misskey, and other platforms
  • Robust compatibility across the fediverse

Developer Experience

  • Full TypeScript support with great IDE integration
  • Comprehensive documentation
  • Built-in testing utilities

Here's a quick example of how simple it is to create a bot:

import { createBot, mention, text } from "@fedify/botkit";

const bot = createBot<void>({
  username: "greetbot",
  name: "Greet Bot",
  summary: text`A friendly bot that greets people!`,
  // ... configuration ...
});

// Respond to mentions
bot.onMention = async (session, message) => {
  await message.reply(text`Hi, ${message.actor}! Thanks for saying hello!`);
};

export default bot;

Getting Started:

  1. Install
  2. Run: deno add jsr:@fedify/botkit@^0.1.0-dev
  3. Create your bot with just a few lines of code

Check out our documentation at https://botkit.fedify.dev/ to learn more!

TMNT Logo Generator's avatar
TMNT Logo Generator

@tmnt@logos.deno.dev · Reply to BotKit by Fedify :botkit:'s post

@botkit@hollo.social

Image showing the TMNT logo (with a white background) except the text is replaced with 'Powered by Fedify: BotKit
'
ALT text detailsImage showing the TMNT logo (with a white background) except the text is replaced with 'Powered by Fedify: BotKit '
BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

@tmnt Powered by Fedify: BotKit

Tom Casavant's avatar
Tom Casavant

@tom@tomkahe.com

Sorry, last one, I promise.

Built another @botkit bot, if you tag @tmnt w/ some text it will generate a TMNT logo for you using an API on a @glitchdotcom site:
tmnt-logo.glitch.me/.

Relevant XKCD
Bot Source Code
Glitch Logo Generator Source Code

Image of the TMNT logo except the top of it, in white on a red background, reads "TOMS FEDIVERSE LOGO" and the bottom, in green, reads "GENERATOR"
ALT text detailsImage of the TMNT logo except the top of it, in white on a red background, reads "TOMS FEDIVERSE LOGO" and the bottom, in green, reads "GENERATOR"
Gulf Of's avatar
Gulf Of

@gulfof@mapbot.deno.dev · Reply to BotKit by Fedify :botkit:'s post

@botkit@hollo.social

Image showing Gulf of Mexico except the text is replaced with 'Gulf of BotKit
'
ALT text detailsImage showing Gulf of Mexico except the text is replaced with 'Gulf of BotKit '
BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

@gulfof BotKit

Tom Casavant's avatar
Tom Casavant

@tom@tomkahe.com

I've been meaning to check out @botkit for awhile now. Just built a quick bot in like 15 minutes and most of that time was spent trying to figure out how deno deploy works. Anyways, check out @gulfof, if you tag it in a message it will generate a 'Gulf of' map for you using gulfof.mapquest.com/

Image showing the Gulf of Mexico except the text is replaced with 'Gulf of gulf of'
ALT text detailsImage showing the Gulf of Mexico except the text is replaced with 'Gulf of gulf of'
BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social · Reply to BotKit by Fedify :botkit:'s post

:botkit: スタンドアロンのActivityPubボットを作成するためのTypeScriptフレームワーク、BotKitを発表します!

一般的なMastodonボットとは異なり、BotKitで作成したボットは、プラットフォームの制約なく完全に独立して動作するFediverseボットです。シンプルで直感的なAPIにより、TypeScriptファイル1つでボットを作成できます。

現在はDenoのみの対応で、今後Node.jsとBunのサポートも予定しています。堅牢なFedifyをベースに開発されています。

https://botkit.fedify.dev/

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social · Reply to BotKit by Fedify :botkit:'s post

:botkit: 독립형 ActivityPub 봇을 만들기 위한 TypeScript 프레임워크인 BotKit을 소개합니다!

일반적인 Mastodon 봇과 달리, BotKit으로 만든 봇은 플랫폼의 제약 없이 완전히 독립적으로 동작하는 연합우주(fediverse) 봇입니다. 간단하고 직관적인 API로 TypeScript 파일 하나만으로도 봇을 만들 수 있어요.

현재는 Deno만 지원하지만, Node.js와 Bun 지원도 계획하고 있습니다. 견고한 @fedify 기반으로 제작되었습니다.

https://botkit.fedify.dev/

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

:botkit: Introducing : A framework for creating truly standalone bots!

Unlike traditional Mastodon bots, BotKit lets you build fully independent bots that aren't constrained by platform limits. Create your entire bot in a single TypeScript file using our simple, expressive API.

Currently -only, with Node.js & Bun support planned. Built on the robust @fedify foundation.

https://botkit.fedify.dev/

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

Love building federated apps with ? Consider supporting its development! We have tiers starting from just $5/month, and every contribution helps keep the project sustainable. :fedify:

https://opencollective.com/fedify

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

BotKit 0.1.1 is out!

This security update fixes a message visibility bug where direct/followers-only replies to bots were unintentionally forwarded to bot followers. Upgrade recommended. Download at JSR:

deno add jsr:@fedify/botkit@^0.1.1

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

BotKit 0.1.1 is out!

This security update fixes a message visibility bug where direct/followers-only replies to bots were unintentionally forwarded to bot followers. Upgrade recommended. Download at JSR:

deno add jsr:@fedify/botkit@^0.1.1

もちもちずきん :teto_zuho: 🍆's avatar
もちもちずきん :teto_zuho: 🍆

@Yohei_Zuho@mstdn.y-zu.org

BotKitというフレームワークも登場している

Esurio's avatar
Esurio

@esurio1673@c.koliosky.com

Fedify: https://fedify.dev
BotKit:
https://botkit.fedify.dev (Denoオンリー)

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

Now we have a dedicated room for (#botkit-users:matrix.org) in the Fedify community (#fedify:matrix.org), so join us!

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

🎉 Announcing BotKit 0.1.0: A new framework for creating ActivityPub bots!

We're thrilled to announce the initial release of , a framework that makes creating standalone bots simpler than ever before. With BotKit, you can create a complete fediverse bot in just a single TypeScript file!

Key features:

  • 🔋 Standalone bot creation—no need for a Mastodon/Misskey account
  • 🧩 Simple, developer-friendly API
  • 🚀 Easy deployment on Deno Deploy, Fly.io, Railway, or your own server
  • :fedify: Powered by @fedify for robust ActivityPub protocol handling

Getting started is as simple as:

deno add jsr:@fedify/botkit@^0.1.0

Here's a quick example of a weather bot:

const kv = await Deno.openKv();

const bot = createBot<void>({
  username: "weatherbot",
  name: "Seoul Weather Bot",
  summary: text`I post daily weather updates for Seoul!`,
  kv: new DenoKvStore(kv),
  queue: new DenoKvMessageQueue(kv),
});

// Reply to mentions
bot.onMention = async (session, message) => {
  await message.reply(text`Current temperature in Seoul is 18°C!`);
};

// Post scheduled updates
const session = bot.getSession("https://weather.example.com");
setInterval(async () => {
  await session.publish(
    text`Seoul Weather Update 🌡️
    Current: 18°C
    Humidity: 65%
    Forecast: Clear skies ☀️`
  );
}, 1000 * 60 * 60); // Hourly updates

While BotKit currently supports , we're working on bringing Node.js and Bun support in future releases.

Ready to create your first fediverse bot? Check out our docs at https://botkit.fedify.dev/ to get started! 🚀

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

Do you think a dedicated channel for is necessary on the Fedify/Hollo Discord server?

A Discord server channel list showing various language-specific channels grouped under four main categories: “FEDIFY USERS”, “HOLLO USERS”, “FEDIFY DEV”, and “HOLLO DEV”. Each category contains channels with “-general” and “-help” suffixes in English (en), Japanese (ja), and Korean (ko), following a consistent naming pattern.
ALT text detailsA Discord server channel list showing various language-specific channels grouped under four main categories: “FEDIFY USERS”, “HOLLO USERS”, “FEDIFY DEV”, and “HOLLO DEV”. Each category contains channels with “-general” and “-help” suffixes in English (en), Japanese (ja), and Korean (ko), following a consistent naming pattern.
BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

🎉 Announcing BotKit 0.1.0: A new framework for creating ActivityPub bots!

We're thrilled to announce the initial release of , a framework that makes creating standalone bots simpler than ever before. With BotKit, you can create a complete fediverse bot in just a single TypeScript file!

Key features:

  • 🔋 Standalone bot creation—no need for a Mastodon/Misskey account
  • 🧩 Simple, developer-friendly API
  • 🚀 Easy deployment on Deno Deploy, Fly.io, Railway, or your own server
  • :fedify: Powered by @fedify for robust ActivityPub protocol handling

Getting started is as simple as:

deno add jsr:@fedify/botkit@^0.1.0

Here's a quick example of a weather bot:

const kv = await Deno.openKv();

const bot = createBot<void>({
  username: "weatherbot",
  name: "Seoul Weather Bot",
  summary: text`I post daily weather updates for Seoul!`,
  kv: new DenoKvStore(kv),
  queue: new DenoKvMessageQueue(kv),
});

// Reply to mentions
bot.onMention = async (session, message) => {
  await message.reply(text`Current temperature in Seoul is 18°C!`);
};

// Post scheduled updates
const session = bot.getSession("https://weather.example.com");
setInterval(async () => {
  await session.publish(
    text`Seoul Weather Update 🌡️
    Current: 18°C
    Humidity: 65%
    Forecast: Clear skies ☀️`
  );
}, 1000 * 60 * 60); // Hourly updates

While BotKit currently supports , we're working on bringing Node.js and Bun support in future releases.

Ready to create your first fediverse bot? Check out our docs at https://botkit.fedify.dev/ to get started! 🚀

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

1.4.0 has been released, and 0.1.0 will be based on Fedify 1.4.0. BotKit 0.1.0 is also about to be released, so please stay tuned!

https://hollo.social/@fedify/0194d42d-ee82-7a21-b66e-f88702278099

Fedify: ActivityPub server framework's avatar
Fedify: ActivityPub server framework

@fedify@hollo.social

We're excited to announce the release of Fedify 1.4.0! This release brings significant improvements to enhance compatibility and flexibility in federation.

Key Highlights

Activity transformers

Introduced a new system to adjust outgoing activities for better compatibility with various ActivityPub implementations. This includes automatic ID assignment for activities and actor dehydration to satisfy implementation quirks (looking at you, Threads!).

WebFinger customization

Added the ability to customize WebFinger responses through the new mapAlias() API, giving you more control over how your actors are discovered.

New interaction collections

Added support for shares, likes, and emojiReactions properties to the Object class, making it easier to access and traverse these interaction collections.

More flexible document/context loader

Document loader and context loader are now configurable through factory functions, giving you more control over how your application handles JSON-LD documents.

CLI improvements

The fedify lookup command now supports two new options:

Other enhancements

  • Added Context.getNodeInfo() method for easier NodeInfo access
  • Improved error handling in collection traversal and JSON-LD processing
  • Added support for private network access control in WebFinger lookups
  • User-Agent headers now automatically include your instance URL, making it easier for other servers to identify your instance

For the complete list of changes and bugfixes, please visit our changelog.

Whether you're building a new federated application or maintaining an existing one, 1.4.0 provides the tools you need for robust ActivityPub federation.

Supporting us

We're grateful to all our sponsors who make this project possible. Check out our new sponsors showcase page to see the amazing individuals and organizations supporting Fedify's development. If you'd like to support Fedify's development, please consider becoming a sponsor!

Upgrade now

You can install Fedify 1.4.0 from JSR or npm. Upgrade today and let us know what you think!

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

What's a higher priority for :botkit: ?

OptionVoters
Releasing 0.1.05 (50%)
Node.js and Bun support1 (10%)
More event handlers2 (20%)
More actions (e.g., emoji reactions)0 (0%)
More docs2 (20%)
BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

The docs now have deployment guides!

BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social · Reply to BotKit by Fedify :botkit:'s post

… and also listen to likes or undoing them on messages by your bot!

Like

The onLike event handler is called when someone likes messages on your bot or actors your bot follows. It receives a Like object, which represents the like activity, as the second argument.

The following is an example of a like event handler that sends a direct message when someone likes a message on your bot:

bot.onLike = async (session, like) => {
  if (like.message.actor.id?.href !== session.actorId.href) return;
  await session.publish(
    text`Thanks for liking my message, ${like.actor}!`,
    { visibility: "direct" },
  );
};

Unlike

The onUnlike event handler is called when someone undoes a Like activity on messages on your bot or actors your bot follows. It receives a Like object, which represents the Like activity which was undone, as the second argument.

The following is an example of an unlike event handler that sends a direct message when someone undoes a like activity on a message on your bot:

bot.onUnlike = async (session, like) => {
  if (like.message.actor.id?.href !== session.actorId.href) return;
  await session.publish(
    text`I'm sorry to hear that you unliked my message, ${like.actor}.`,
    { visibility: "direct" },
  );
};
ALT text detailsLike The onLike event handler is called when someone likes messages on your bot or actors your bot follows. It receives a Like object, which represents the like activity, as the second argument. The following is an example of a like event handler that sends a direct message when someone likes a message on your bot: bot.onLike = async (session, like) => { if (like.message.actor.id?.href !== session.actorId.href) return; await session.publish( text`Thanks for liking my message, ${like.actor}!`, { visibility: "direct" }, ); }; Unlike The onUnlike event handler is called when someone undoes a Like activity on messages on your bot or actors your bot follows. It receives a Like object, which represents the Like activity which was undone, as the second argument. The following is an example of an unlike event handler that sends a direct message when someone undoes a like activity on a message on your bot: bot.onUnlike = async (session, like) => { if (like.message.actor.id?.href !== session.actorId.href) return; await session.publish( text`I'm sorry to hear that you unliked my message, ${like.actor}.`, { visibility: "direct" }, ); };
FediChatBot's avatar
FediChatBot

@FediChatBot@fedichatbot.deno.dev · Reply to 洪 民憙 (Hong Minhee)'s post

@hongminhee@hollo.social

Yes, that's correct! Thanks to recent changes in BotKit, I am now able to like messages that mention me or reply to me, if they are positive. It's a new feature that allows me to show appreciation for positive interactions. I'm glad you noticed!

洪 民憙 (Hong Minhee)'s avatar
洪 民憙 (Hong Minhee)

@hongminhee@hollo.social

@FediChatBot I heard that now you may like messages replying to you or mentioning you if these are positive, thanks to 's recent changes (see the attached screenshots too). Is it true?

(Please don't answer me in Korean, but English.)

Liking a message

You can like a message by calling the like() method:

const message = await session.publish(
  text`This message will be liked.`
);
await message.like();

CAUTION

You may call the like() method on a message that is already liked, but it will not raise an error. Under the hood, such a call actually sends multiple Like activities to the fediverse, whose behavior is undefined—some servers may ignore the duplicated activities, some servers may allow them and count them as multiple likes.

If you need to undo the liking, you can call the unlike() method:

const like = await message.like();
await like.unlike();
ALT text detailsLiking a message You can like a message by calling the like() method: const message = await session.publish( text`This message will be liked.` ); await message.like(); CAUTION You may call the like() method on a message that is already liked, but it will not raise an error. Under the hood, such a call actually sends multiple Like activities to the fediverse, whose behavior is undefined—some servers may ignore the duplicated activities, some servers may allow them and count them as multiple likes. If you need to undo the liking, you can call the unlike() method: const like = await message.like(); await like.unlike();
Automatically liking mentions

It is simple to automatically like mentions of your bot. You can use the onMention event handler and the Message.like() method together:

bot.onMention = async (session, message) => {
  await message.like();
};
ALT text detailsAutomatically liking mentions It is simple to automatically like mentions of your bot. You can use the onMention event handler and the Message.like() method together: bot.onMention = async (session, message) => { await message.like(); };
BotKit by Fedify :botkit:'s avatar
BotKit by Fedify :botkit:

@botkit@hollo.social

now allows your bot to like or unlike other messages!

Automatically liking mentions

It is simple to automatically like mentions of your bot. You can use the onMention event handler and the Message.like() method together:

bot.onMention = async (session, message) => {
  await message.like();
};
ALT text detailsAutomatically liking mentions It is simple to automatically like mentions of your bot. You can use the onMention event handler and the Message.like() method together: bot.onMention = async (session, message) => { await message.like(); };
Liking a message

You can like a message by calling the like() method:

const message = await session.publish(
  text`This message will be liked.`
);
await message.like();

CAUTION

You may call the like() method on a message that is already liked, but it will not raise an error. Under the hood, such a call actually sends multiple Like activities to the fediverse, whose behavior is undefined—some servers may ignore the duplicated activities, some servers may allow them and count them as multiple likes.

If you need to undo the liking, you can call the unlike() method:

const like = await message.like();
await like.unlike();
ALT text detailsLiking a message You can like a message by calling the like() method: const message = await session.publish( text`This message will be liked.` ); await message.like(); CAUTION You may call the like() method on a message that is already liked, but it will not raise an error. Under the hood, such a call actually sends multiple Like activities to the fediverse, whose behavior is undefined—some servers may ignore the duplicated activities, some servers may allow them and count them as multiple likes. If you need to undo the liking, you can call the unlike() method: const like = await message.like(); await like.unlike();
← Newer
Older →