2
0
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:
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; 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;
} }

View File

@@ -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>;