-
-
Save tahirbhatti78/cd348907874c344007a4e0790cbe7cdb to your computer and use it in GitHub Desktop.
Download gdrive file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { bot, isUrl, getImgUrl } = require('../lib/') | |
| bot( | |
| { | |
| pattern: 'mdrive ?(.*)', | |
| desc: 'Download from Google Drive link', | |
| type: 'download', | |
| }, | |
| async (x, y) => { | |
| y = y || x.reply_message.text; | |
| if (!y || !y.includes('drive.google.com')) return await x.send('Example: mdrive <Google Drive URL>'); | |
| const z = y.match(/\/file\/d\/(.*?)\//); | |
| if (!z) return await x.send('Invalid Google Drive link'); | |
| const a = z[1]; | |
| const b = `https://drive.google.com/uc?id=${a}&authuser=0&export=download`; | |
| try { | |
| await x.sendFromUrl(b, { | |
| buffer: true, | |
| caption: 'Developed By ╰ᴹᵘʰᵃᵐᵐᵃᵈ ᴹᵃᵏᵏⁱ╯ & 𝘋𝘳. 𝘛𝘈𝘠𝘠𝘈𝘉「佐罗」', | |
| }); | |
| } catch (c) { | |
| await x.send('Failed to download the file. Please check the link.'); | |
| } | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment