Skip to content

Commit 0fabca1

Browse files
committed
Update typings
1 parent b340ea3 commit 0fabca1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

handlers/middlewares/removeChannelForwards.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ const { optional, passThru } = require('telegraf');
66
const { excludeLinks = [] } = require('../../utils/config').config;
77

88
if (excludeLinks === false || excludeLinks === '*') {
9+
10+
/** @type { import('../../typings/context').GuardMiddlewareFn } */
911
module.exports = passThru();
1012
return;
1113
}

typings/context.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ContextMessageUpdate } from 'telegraf';
1+
import type { Context, MiddlewareFn } from 'telegraf';
22
import type {
33
User,
44
Message,
@@ -33,6 +33,8 @@ export interface ContextExtensions {
3333
): Promise<Message>;
3434
}
3535

36-
export type ExtendedContext = ContextExtensions & ContextMessageUpdate & {
36+
export type ExtendedContext = ContextExtensions & Context & {
3737
from?: DbUser,
3838
};
39+
40+
export type GuardMiddlewareFn = MiddlewareFn<ExtendedContext>;

0 commit comments

Comments
 (0)