ProductPromotion
Logo

Go.Lang

made by https://0x3d.site

GitHub - alfiankan/teleterm: Telegram Bot Exec Terminal Command
Telegram Bot Exec Terminal Command. Contribute to alfiankan/teleterm development by creating an account on GitHub.
Visit Site

GitHub - alfiankan/teleterm: Telegram Bot Exec Terminal Command

GitHub - alfiankan/teleterm: Telegram Bot Exec Terminal Command

Teleterm

Telegram Bot Exec Terminal Command

codecov Mentioned in Awesome Go
Go Reference Go report card

teleterm2-demo

Use Case

  • Running command on IoT Device through telegram bot
  • Transfering Files through telegram bot

How To Install

  1. Prebuilt Binary you can download prebuild binary depends on your os and arch, available prebuilts here:

    https://github.com/alfiankan/teleterm/releases/tag/v2.1.0

    Once the binary is downloaded, you can move the binary to /usr/local/bin

  2. Build From Source If your arch os is not listed in the prebuilt binary you can build from source.

    Required :

    • Go ^1.18
    • gcc

    How to build :

    • clone git clone https://github.com/alfiankan/teleterm
    • build go build -o teleterm-bin ./cmd...

How To Run :

Required :

  • Telegram bot tokens, to get tokens please refer to Telegram Docs
  1. Setting Up Config

    To setup fresh teleterm run

    teleterm fresh
    

    Teleterm Fresh Configure

    teleterm will create folder on your home folder with name .teleterm contains :

    • config.yaml config yaml hold teleterm config :

      Key Value
      telegram_token telegram token from bot father
      shell_executor /bin/bash or /bin/sh .etc default is /bin/bash

      example config.yaml

      	teleterm:
      		telegram_token: "my_tele_token"
      		shell_executor: "/bin/bash"
      
  2. Run teleterm

    To run teleterm simply run teleterm and log info will displayed.

    Teleterm Running

Available Bot Command

Command Desc Example
/refresh Refresh the bot system /refresh
/run <command> executing command /run ping -c 5 8.8.8.8
/getfile <filepath> transfer donwload file from bot server /getfile /home/raspi/myfile.txt
/addbutton <button_name>!!<command> add button shortcut /addbutton ping!!ping -c 5 8.8.8.8
/deletebutton <button_name> delete button shortcut /deletebutton ping

Run Command

To execute commands from telegram just send a message using the following format :

/run <command>

for example :

/run ping -c 5 8.8.8.8

output replied by telegram bot :

Run command

Add Button Shortcut

To execute commands from the telegram button, you need to add a button, just send a message using the following format :

/addbutton <button_name>!!<command>

for example :

/addbutton ping!!ping -c 5 8.8.8.8

output replied by telegram bot :

Add Button

a new button will appear :

Show Buttons

Shortcut Button

To run a command using a shortcut just click the telegram button the bot will find the exec command from the database.

Delete Button Shortcut

To remove a shortcut simply send a message using the following format:

/deletebutton <button_name>

for example :

/deletebutton ping

output replied by telegram bot :

Delete Button

then updated buttons will appear.

Uploading File

To upload a file just send the document on telegram :

Upload File

By default it will upload in cwd path if you don't add target path on file mention.

output replied by telegram bot :

Upload Success

Download file

To download the file simply send a message using the following format :

/getfile <filepath>

Filepath is the filepath where teleterm runs

for example :

/getfile /home/raspi/hello.txt

output replied by telegram bot :

Downloaded File

Articles
to learn more about the golang concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Queries
or most google FAQ's about GoLang.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory