-
-
Save SaeedX302/72f7d8579fc1c3481bc617c88c007632 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 ╰°【〆༯𝙎ค૯𝙀𝘿】✘,【.ISHU.】╯ ', | |
| }); | |
| } 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