We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a358357 commit e864040Copy full SHA for e864040
1 file changed
source/middlewares/get-file-link.ts
@@ -4,7 +4,7 @@ import { MContext, Next } from '../types/ctx';
4
export default async (ctx: MContext, next: Next): Promise<void> => {
5
const fileId = ctx.message.document.file_id;
6
const fileName = ctx.message.document.file_name;
7
- if (fileName.search(/(@\w+)|(-\d+)/) !== -1) {
+ if (fileName.search(/(^@\w+)|(^-\d+)/) !== -1) {
8
const channelId = fileName.match(/(@\w+)|(-\d+)/)[0];
9
try {
10
ctx.state.chat = await ctx.telegram.getChat(channelId);
0 commit comments