README
¶
Telegram Backend for RClone (Still Under Development) Broken at the moment
This is a backend for RClone that allows you to use Telegram as a remote storage service.
Installation
To use this backend, you need to have RClone installed. You can download the latest version of RClone from their official website.
To use this backend, you also need to have a Telegram bot and chat ID. You can create a bot and obtain the chat ID by following the instructions in Telegram's Bot API documentation.
Once you have RClone and a Telegram bot set up, you can install this backend by running the following command:
go install github.com/thinhdnn/RcloneTelegram@latest
Configuration
To use this backend, you need to add it to your RClone configuration file. You can do this by running the following command:
rclone config
Then, follow the prompts to configure the backend. You will need to provide your Telegram bot token and chat ID.
Here's an example configuration:
[mytelegram]
type = telegram
token = <your-telegram-bot-token>
chat_id = <your-telegram-chat-id>
You can replace "mytelegram" with any name you like.
How to Test
Since this code is still in development, it is recommended that you test it thoroughly before using it for production purposes.
To test the backend, you can try running the following RClone commands:
rclone lsf mytelegram:/
This should list the contents of your Telegram chat.
rclone copy /path/to/local/file mytelegram:/remote/path
This should upload the local file to your Telegram chat.
rclone copy mytelegram:/remote/path /path/to/local/file
This should download the remote file from your Telegram chat to the local file system.
Note that the Telegram backend only supports files up to 2GB in size.
Community
Documentation
¶
Index ¶
- func NewFs(name string, m configmap.Mapper) (fs.Fs, error)
- type Fs
- func (f *Fs) Features() *vfs.Features
- func (f *Fs) Hashes() hash.Set
- func (f *Fs) List(ctx context.Context, dir string) (fs.DirChan, fs.EntryChan, error)
- func (f *Fs) Mkdir(ctx context.Context, dir string) error
- func (f *Fs) Name() string
- func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error)
- func (f *Fs) Precision() time.Duration
- func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
- func (f *Fs) Rmdir(ctx context.Context, dir string) error
- func (f *Fs) Root() string
- func (f *Fs) String() string
- type Object
- func (o *Object) Fs() fs.Info
- func (o *Object) Hash(r hash.Type) (string, error)
- func (o *Object) ModTime(ctx context.Context) time.Time
- func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error)
- func (o *Object) Remote() string
- func (o *Object) Remove(ctx context.Context) error
- func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error
- func (o *Object) Size() int64
- func (o *Object) Storable() bool
- func (o *Object) String() string
- func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fs ¶
type Fs struct {
// contains filtered or unexported fields
}
Fs represents a remote Telegram chat
func (*Fs) List ¶
List returns a channel to the objects and subdirectories in dir with directory entries popped from the channel
func (*Fs) Put ¶
func (f *Fs) Put(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
Put uploads contents to the remote path
func (*Fs) PutStream ¶
func (f *Fs) PutStream(ctx context.Context, in io.Reader, src fs.ObjectInfo, options ...fs.OpenOption) (fs.Object, error)
PutStream uploads contents to the remote path using a stream
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
Object represents a remote Telegram file
func (*Object) Hash ¶
Hash returns the selected checksum of the file If no checksum is available it returns ""
func (*Object) Open ¶
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadCloser, error)
Open opens the file for read
func (*Object) SetModTime ¶
SetModTime sets the modification time of the file