tips:telegram

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
tips:telegram [2018/04/03 20:12] – [Desktop Installer] scipiotips:telegram [2022/04/12 08:07] (current) sscipioni
Line 2: Line 2:
  
 {{tag>[telegram bot]}} {{tag>[telegram bot]}}
 +
 +===== channel =====
 +
 +send message to channel from bot (BOT_API_KEY required):
 +  - add bot to channel as admin
 +  - send message
 +
 +<code>
 +curl https://api.telegram.org/bot[BOT_API_KEY]/sendMessage?chat_id=@[MY_CHANNEL_NAME]&text=[MY_MESSAGE_TEXT]
 +</code>
 +
  
 ===== BOT ===== ===== BOT =====
Line 200: Line 211:
  
  
-===== Desktop Installer ===== 
  
-<code bash> 
-#!/bin/bash 
-  
-echo "=============================================" 
-echo "==     Telegram Script Installer v 0.1     ==" 
-echo "==                                         ==" 
-echo "==            by Jalcaldea                 ==" 
-echo "=============================================" 
-  
-echo "Downloading necesary files..." 
-  
-cd /tmp 
-wget -O - https://tdesktop.com/linux > tsetup.tar.gz 
-wget -O - https://raw.githubusercontent.com/telegramdesktop/tdesktop/master/Telegram/Telegram/Images.xcassets/Icon.iconset/icon_256x256@2x.png > icon.png 
-  
-echo "Making destination folder..." 
-  
-sudo mkdir /usr/share/telegram 
-sudo chmod +x /usr/share/telegram 
-  
-echo "Extracting files..." 
-  
-tar -xvJf tsetup.tar.gz 
-cd ./Telegram 
-  
-echo "Copying new files..." 
-sudo cp ./Updater /usr/share/telegram/Updater 
-sudo cp ./Telegram /usr/share/telegram/Telegram 
-user=$(whoami) 
-sudo chown -R $user:$user /usr/share/telegram/. 
-  
-echo "Making desktop files..." 
-  
-cd /tmp 
-  
-sudo echo "[Desktop Entry]" > telegram.desktop 
-sudo echo "Name=Telegram" >> telegram.desktop 
-sudo echo "GenericName=Chat" >> telegram.desktop 
-sudo echo "Comment=Chat with yours friends" >> telegram.desktop 
-sudo echo "Exec=/usr/share/telegram/Telegram" >> telegram.desktop 
-sudo echo "Terminal=false" >> telegram.desktop 
-sudo echo "Type=Application" >> telegram.desktop 
-sudo echo "Icon=/usr/share/telegram/icon.png" >> telegram.desktop 
-sudo echo "Categories=Network;Chat;" >> telegram.desktop 
-sudo echo "StartupNotify=false" >> telegram.desktop 
-  
-sudo cp icon.png /usr/share/telegram/icon.png 
-sudo cp telegram.desktop /usr/share/applications/telegram.desktop 
-  
-echo "Removing old files..." 
-  
-rm /tmp/tsetup.tar.gz 
-rm /tmp/icon.png 
-rm /tmp/telegram.desktop 
-rm -R /tmp/Telegram 
-  
-  
-echo "Installation Complete! Launching Telegram..." 
-  
-/usr/share/telegram/Updater & 
- 
-</code> 
  • tips/telegram.1522779167.txt.gz
  • Last modified: 2018/04/03 20:12
  • by scipio