README.md (2700B)
1 linkchanbot 2 =========== 3 4 A Telegram Bot which sanitises and substitutes share links 5 with lightweight, privacy respecting proxy frontend alternatives. 6 7 - Main instance: [@linkchanbot](https://t.me/linkchanbot) 8 - User updates: [@linkchan\_updates](https://t.me/linkchan_updates) 9 10 ![screenshot](https://i.imgur.com/WnbOD5c.jpg) 11 12 Supported services (configurable): 13 14 - twitter.com => Nitter 15 - youtube.com => Inividious, CloudTube 16 - instagram.com => Bibliogram 17 - reddit.com => Teddit, Libreddit, Old Reddit 18 19 20 Installation 21 ------------ 22 23 ### Prerequisites 24 25 - A Telegram bot token (visit [@botfather](https://t.me/botfather)). 26 27 ### Dependencies 28 29 - [scdoc](https://sr.ht/~sircmpwn/scdoc) (build dep.) 30 - Python >= 3.9 31 - PyPI: python-telegram-bot >= 13 32 33 ### Install 34 35 $ git clone https://git.sr.ht/~torresjrjr/linkchanbot 36 $ cd linkchanbot 37 $ python -m pip install -r requirements.txt 38 # make install 39 40 To start serving, linkchanbot needs further configuration. 41 42 43 Configuration 44 ------------- 45 46 ### Telegram 47 48 - Visit [@botfather](https://t.me/botfather). 49 - Create a new bot (or select an existing one). 50 - Save the bot API token. 51 - Disable "Group Privacy mode". 52 - Enable "Inline mode". 53 - Set the "inline placeholder" to "Paste link...". 54 - Optionally set "inline feedback" to "100%" for logging. 55 - Set the bot commands: `/start`, `/help`, and `/about`. 56 57 ### Server 58 59 Add the required bot token (and optionally an admin username) 60 either in `bot.cfg` in the linkchan config directory 61 (`$XDG_CONFIG_HOME/linkchan` or `$HOME/.config/linkchan`): 62 63 [auth] 64 # required 65 token = 123:ABC... 66 # optional, provides /restart and /shutdown 67 admin = username 68 69 Or by environment variable: 70 71 $ export LINKCHAN_TOKEN='123:ABC...' 72 $ export LINKCHAN_ADMIN='admin_username' 73 74 Your bot should now be ready. 75 76 ### Advanced configuration 77 78 See `linkchanbot(1)` 79 80 81 Updating 82 -------- 83 84 linkchanbot comes with a preconfigured list of 'alts' (proxies) and 85 other configuration data. This data is updated with new commits. On 86 start-up, linkchanbot copies this data in the absence of locally 87 configured data to `XDG_CONFIG_HOME/linkchan` (`bot.cfg` is untouched). 88 89 To fully update linkchanbot and its configuration data, perform a normal 90 installtion with the latest commit, then remove (and backup) the local 91 configuration files and restart linkchanbot. 92 93 shell: 94 $ rm ~/.config/linkchan/alts.json 95 $ rm ~/.config/linkchan/services.json 96 Telegram: 97 /restart (or manaully in the shell) 98 99 100 Usage 101 ----- 102 103 See `linkchanbot(1)` or `linkchanbot --help`. 104 105 106 Resources 107 --------- 108 109 - License: GNU Affero General Public License 110 - Project page: <https://sr.ht/~torresjrjr/linkchanbot> 111 - Mailing list: <~torresjrjr/linkchanbot@lists.sr.ht> (patches & discussion) 112