Skip to content

Commit

Permalink
fix: group import filename
Browse files Browse the repository at this point in the history
  • Loading branch information
fengkx committed Jan 16, 2021
1 parent a358357 commit e864040
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/middlewares/get-file-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { MContext, Next } from '../types/ctx';
export default async (ctx: MContext, next: Next): Promise<void> => {
const fileId = ctx.message.document.file_id;
const fileName = ctx.message.document.file_name;
if (fileName.search(/(@\w+)|(-\d+)/) !== -1) {
if (fileName.search(/(^@\w+)|(^-\d+)/) !== -1) {
const channelId = fileName.match(/(@\w+)|(-\d+)/)[0];
try {
ctx.state.chat = await ctx.telegram.getChat(channelId);
Expand Down

0 comments on commit e864040

Please sign in to comment.