hydrateChatMember
ref / chat-members / hydrateChatMember
Api transformer that adds a convenient is
method to the objects returned by get
, get
, and get
.
Example:
typescript
const bot = new Bot<HydrateChatMemberFlavor<Context>>("");
bot.api.config.use(hydrateChatMember());
bot.on("message", async (ctx) => {
const author = await ctx.getAuthor();
if (author.is("admin")) {
author.status; // "creator" | "administrator"
}
});
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
Type Parameters
R
Return Type
ts
Transformer<R>