2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 06:05:22 +00:00

Update typings

This commit is contained in:
Wojciech Pawlik
2020-04-03 15:46:01 +02:00
parent b340ea368e
commit 0fabca1040
2 changed files with 6 additions and 2 deletions

View File

@@ -6,6 +6,8 @@ const { optional, passThru } = require('telegraf');
const { excludeLinks = [] } = require('../../utils/config').config;
if (excludeLinks === false || excludeLinks === '*') {
/** @type { import('../../typings/context').GuardMiddlewareFn } */
module.exports = passThru();
return;
}

View File

@@ -1,4 +1,4 @@
import type { ContextMessageUpdate } from 'telegraf';
import type { Context, MiddlewareFn } from 'telegraf';
import type {
User,
Message,
@@ -33,6 +33,8 @@ export interface ContextExtensions {
): Promise<Message>;
}
export type ExtendedContext = ContextExtensions & ContextMessageUpdate & {
export type ExtendedContext = ContextExtensions & Context & {
from?: DbUser,
};
export type GuardMiddlewareFn = MiddlewareFn<ExtendedContext>;