mirror of
https://github.com/thedevs-network/the-guard-bot
synced 2025-09-01 22:55:24 +00:00
Update typings
This commit is contained in:
@@ -6,6 +6,8 @@ const { optional, passThru } = require('telegraf');
|
|||||||
const { excludeLinks = [] } = require('../../utils/config').config;
|
const { excludeLinks = [] } = require('../../utils/config').config;
|
||||||
|
|
||||||
if (excludeLinks === false || excludeLinks === '*') {
|
if (excludeLinks === false || excludeLinks === '*') {
|
||||||
|
|
||||||
|
/** @type { import('../../typings/context').GuardMiddlewareFn } */
|
||||||
module.exports = passThru();
|
module.exports = passThru();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
6
typings/context.d.ts
vendored
6
typings/context.d.ts
vendored
@@ -1,4 +1,4 @@
|
|||||||
import type { ContextMessageUpdate } from 'telegraf';
|
import type { Context, MiddlewareFn } from 'telegraf';
|
||||||
import type {
|
import type {
|
||||||
User,
|
User,
|
||||||
Message,
|
Message,
|
||||||
@@ -33,6 +33,8 @@ export interface ContextExtensions {
|
|||||||
): Promise<Message>;
|
): Promise<Message>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExtendedContext = ContextExtensions & ContextMessageUpdate & {
|
export type ExtendedContext = ContextExtensions & Context & {
|
||||||
from?: DbUser,
|
from?: DbUser,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type GuardMiddlewareFn = MiddlewareFn<ExtendedContext>;
|
||||||
|
Reference in New Issue
Block a user