Skip to content

Commit bdba711

Browse files
authored
v1.3.1
1 parent 5124adb commit bdba711

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ python3 telegramShellBot.py & (this will run the script in backgrou
6868
![alt tag](/readme_images/image4.png)
6969

7070

71+
## Sending and receiving files
72+
To send files just drag and drop on the chat, or click on send file button (images must be sent this way).
73+
To download files from the computer use "getfile + path" (e.g. getfile /home/user/Desktop/test-file.txt).
74+
75+
![alt tag](/readme_images/gif2.gif)
76+
7177

7278
## Version history
7379
Check [project releases](https://github.com/EnriqueMoran/remoteTelegramShell/releases) for more info.
@@ -80,4 +86,12 @@ Check [project releases](https://github.com/EnriqueMoran/remoteTelegramShell/rel
8086
- **v1.0:** (6/21/18) Official release. Critical and minor bug fixed. New forbidden commands added.
8187
- **v1.1.2:** (3/8/19) Typo correction, top command added, Telegram API 400 Bad Request error fixed.
8288
- **v1.2.0:** (1/25/20) Install and uninstall package infinite loop fixed, config.txt and readme modified.
83-
- **v1.2.1:** (1/26/20) Update and upgrade system infinite loop fixed, config parameters checker added.
89+
- **v1.2.1:** (1/26/20) Update and upgrade system infinite loop fixed, config parameters checker added.
90+
- **v1.3.1:** (6/12/20) File sending and receiving feature added.
91+
92+
93+
94+
95+
todo: agregar la sharedfolder
96+
hacer que se puedan eliminar usuarios desde telegram, que salga bonito, etc
97+
hacer que el loglimit funcione

config.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
# this file and fill the following parameters in order to correctly configure the program.
66

77

8-
# File sharing folder - Absolute path to file sharing folder. All files sent through
9-
# drag and drop will be stored there, dont choose a root-protected one.
10-
shareFolder = ./shareFolder
8+
# File sharing folder - Absolute path to file sharing folder (ending in slash). All files
9+
# sent through drag and drop will be stored there, dont choose a root-protected one.
10+
shareFolder = ./shareFolder/
1111

1212

1313
# Version - This parameter is automatically filled. Current version will be shown on /help
1414
# option. Please do not modify.
15-
version = v1.3.0
15+
version = v1.3.1
1616

1717

1818
# TOKEN - This is bot auth token, necessary to connect bot to Telegram device.

readme_images/gif2.gif

1.8 MB
Loading

telegramShellBot.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def checkConfig(message):
115115
if ROOT == "":
116116
error = True
117117
error_msg += "\n- Root field is empty."
118-
bot.send_message(message.chat.id, error_msg)
118+
if error:
119+
bot.send_message(message.chat.id, error_msg)
119120
return error
120121

121122

@@ -410,10 +411,10 @@ def run(message):
410411
def saveDoc(doc):
411412
fileInfo = bot.get_file(doc.document.file_id)
412413
downloadedFile = bot.download_file(fileInfo.file_path)
413-
filepath = SHAREFOLDER + '\\' + doc.document.file_name
414-
with open(filepath, 'wb') as newFile:
414+
filePath = SHAREFOLDER + doc.document.file_name
415+
with open(filePath, 'wb') as newFile:
415416
newFile.write(downloadedFile)
416-
bot.send_message(message.chat.id,"File received.")
417+
bot.send_message(doc.chat.id,f"File saved as {filePath}")
417418

418419
@bot.message_handler(content_types=['photo'])
419420
def savePhoto(doc):

0 commit comments

Comments
 (0)