Coder Social home page Coder Social logo

file-upload-bot's Introduction

File/Folder Upload Bot

A dead simple Telegram bot to upload your local files by file path or folder path. Can be used as a backup helper. Originally, I created this bot to automate backing up my files to Telegram while I change or reinstall my Linux distro. For example, if you have a directory of videos, you can use this bot to upload them for you. With some slight modifications, you can make it upload as you want. With a local bot API server you can also make it support files upto 2GB in size.

Demo usage preview

It's a bit older preview, but it still almost the same thing. The command /folder has been changed to /upload after adding the support for both files and folders.


  • It would be cool to have index messages of the uploaded files. (in groups and channels)
  • ZIP/RAR/TAR support?

Setup

You need Deno to run this bot. I created this bot on v1.18.2. Also, I recommend setting up a local bot API server and increasing your file size limit.

1. Clone the repository

git clone https://github.com/dcdunkan/folder-upload-bot
cd folder-upload-bot

2. Configure the .env variables

You can either set them in a .env file in the root of this repo folder, or you can set them using export ADMIN_ID=1234567890 in your terminal.

  • BOT_TOKEN: Telegram Bot token. Get yours from https://t.me/BotFather.
  • ADMIN_ID: The user ID of the owner. Because- you know, you don't want other people downloading your private files, right?
  • API_ROOT: Set this to the URL of your local api server, if you have one.

3. Run bot.ts

deno run --allow-net --allow-read --allow-env bot.ts
  • --allow-net: For internet access.
  • --allow-env: For accessing required ENV variables.
  • --allow-read: To read files from your machine.

If you have everything done right, your bot should be running, and you should see a message "<bot_username> started." in your console.

But if you're still having issues, please open an issue here :)

file-upload-bot's People

Contributors

dcdunkan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.