Skip to content

Commit

Permalink
temporarily disabling pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
theofandrich committed Oct 13, 2023
1 parent c421dcf commit 2b2da8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/modules/document-handler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export class DocumentHandler implements PayableBot {
ctx.transient.analytics.module = this.module
try {
const file = await ctx.getFile()
const documentType = null
// const documentType = ctx.message.document?.mime_type
const documentType = ctx.message.document?.mime_type
if (documentType === 'application/pdf' && ctx.chat.id) {
const url = file.getUrl()
const fileName = ctx.message.document?.file_name ?? file.file_id
Expand Down
10 changes: 5 additions & 5 deletions src/modules/llms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ export class LlmsBot implements PayableBot {
}

isSupportedPdfFile (ctx: OnMessageContext | OnCallBackQueryData): boolean {
const documentType = ctx.message?.document?.mime_type
const SupportedDocuments = { PDF: 'application/pdf' }
// const documentType = ctx.message?.document?.mime_type
// const SupportedDocuments = { PDF: 'application/pdf' }

if (documentType !== undefined) {
return Object.values(SupportedDocuments).includes(documentType)
}
// if (documentType !== undefined) {
// return Object.values(SupportedDocuments).includes(documentType)
// }
return false
}

Expand Down

0 comments on commit 2b2da8d

Please sign in to comment.