All Projects → LucaTNT → telegram-bot-amazon

LucaTNT / telegram-bot-amazon

Licence: other
Telegram bot to replace Amazon affiliate tags in links

Programming Languages

javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to telegram-bot-amazon

RPi-TELEBOT
Python based Telegram bot to monitor and control the raspberry pi
Stars: ✭ 19 (-24%)
Mutual labels:  telegram-bot
Telegram Vc Bot
A bot that can play music on telegram group's voice chat.
Stars: ✭ 94 (+276%)
Mutual labels:  telegram-bot
Bybit-Auto-Trading-Bot-Ordes-placed-via-TradingView-Webhook
Python based Trading Bot that uses TradingView.com webhook JSON alerts to place orders(buy/sell/close/manage positions/TP/SL/TS etc.) on Bybit.com. Hire me directly here https://www.freelancer.com/u/Beannsofts for any assistance
Stars: ✭ 235 (+840%)
Mutual labels:  telegram-bot
LyricsPyRobot
A Telegram bot for searching lyrics.
Stars: ✭ 29 (+16%)
Mutual labels:  telegram-bot
SWRATT
🤖 ☠️ 💬 A simple Telegram Bot that controls the victim's computer.
Stars: ✭ 38 (+52%)
Mutual labels:  telegram-bot
BTB-manager-telegram
A feature packed but easy-to-use Telegram bot for remotely managing Binance Trade Bot instances
Stars: ✭ 337 (+1248%)
Mutual labels:  telegram-bot
Pyro-FileStreamBot
Stream Telegram files to web
Stars: ✭ 38 (+52%)
Mutual labels:  telegram-bot
nosticker bot
Bot that fights telegram stickers
Stars: ✭ 18 (-28%)
Mutual labels:  telegram-bot
All-Url-Uploader
A simple telegram Bot, Upload Media File| video To telegram using the direct download link. (youtube, Mediafire, google drive, mega drive, etc)
Stars: ✭ 122 (+388%)
Mutual labels:  telegram-bot
trackrBot
A chatbot that helps you set price alerts for your amazon products.
Stars: ✭ 18 (-28%)
Mutual labels:  telegram-bot
pong
Basic uptime monitoring system, with email alerts and/or push notifications
Stars: ✭ 94 (+276%)
Mutual labels:  telegram-bot
remindbot
Hazel - a Golang Telegram Bot for Reminders
Stars: ✭ 42 (+68%)
Mutual labels:  telegram-bot
tele-vdo-rider
Telegram bot to convert online videos to audio (mp3)
Stars: ✭ 17 (-32%)
Mutual labels:  telegram-bot
joinhider bot
Telegram bot to delete user joined messages
Stars: ✭ 20 (-20%)
Mutual labels:  telegram-bot
allukabot
Modular HunterxHunter themed Telegram Bot for managing your group with additional features.
Stars: ✭ 21 (-16%)
Mutual labels:  telegram-bot
Telegram-bot-Google-Drive
Simple Telegram bot Google Drive integration example
Stars: ✭ 46 (+84%)
Mutual labels:  telegram-bot
RAM-UBOT
USERBOT TELEGRAM BUAT SENENG-SENENG AJA BLOK!
Stars: ✭ 69 (+176%)
Mutual labels:  telegram-bot
telegram-bot-rpi-camera
Telegram bot for capturing images with Raspberry Pi camera module
Stars: ✭ 13 (-48%)
Mutual labels:  telegram-bot
TGInlineGIF
Telegram Inline tenor gif search bot.
Stars: ✭ 19 (-24%)
Mutual labels:  telegram-bot
smsq
Receive your SMS messages in Telegram
Stars: ✭ 48 (+92%)
Mutual labels:  telegram-bot

This is a Telegram bot that, if made admin of a group, will delete any message containing an Amazon link and re-post it tagged with the specified affiliate tag.

It can be either messaged directly, or added as an administrator to a group or supergroup.

If messaged directly, it replies with the affiliate link, while in a group it will delete any message containing an Amazon link and replace it with a new message, with a format that is customizable through the GROUP_REPLACEMENT_MESSAGE environment variables.

Configuration

It requires two parameters through environment variables:

  • TELEGRAM_BOT_TOKEN (required) is the token obtained from @Botfather.
  • AMAZON_TAG (required) is the Amazon affiliate tag to be used when rewriting URLs.

You can set two optional parameters through environment variables:

  • SHORTEN_LINKS: if set to "true", all the sponsored links generated by the bot will be passed through the bitly shortener, which generates amzn.to links.
  • BITLY_TOKEN (required if SHORTEN_LINKS is "true") is the Generic Access Token you can get from bitly.
  • AMAZON_TLD is the Amazon TLD for affiliate links (it defaults to "com", but you can set it to "it", "de", "fr" or whatever).
  • GROUP_REPLACEMENT_MESSAGE specifies the format for the message that gets posted to groups after deleting the original one. If not set, it will default to Message by {USER} with Amazon affiliate link:\n\n{MESSAGE}. In the following table you'll find variables you can use.
  • RAW_LINKS: if set to "true" disables this bot's "URL beautifier" (which removes all the URL parameters aside from the ASIN and the affiliate tag) and just adds/replaces the tag to the URL. This allows to link to arbitrary pages on Amazon, even non-product ones (e.g. search pages, category pages, etc.)
  • CHECK_FOR_REDIRECTS: if set to "true" the bot will look for redirects in the provided links. This allows it to find links to Amazon even if they are hidden behind URL shorteners. Please note that this check requires a bit more time than looking for "regular" Amazon URLs, since the bot needs to connect to each URL.
  • CHECK_FOR_REDIRECT_CHAINS: if set to "true" the bot will perform a recursive search for redirects. This allows it to catch Amazon URLs even if they are hidden behind a chain of redirects. This will slow down the processing of redirects.
  • MAX_REDIRECT_CHAIN_DEPTH: if CHECK_FOR_REDIRECT_CHAINS is enabled, it will limit the number of redirect levels the bot will try to go through. It default to 2, and it should be kept at a low number to avoid wasting time going through endless redirect chains a user might provide.
  • IGNORE_USERS: a comma-separated list of usernames (starting with the "@" character) and numeric user IDs whose messages won't be acted upon by the bot, even if they contain matching Amazon links. A valid list would be "@Yourusername,12345678,@IgnoreMeAsWell123". Numeric user IDs are useful for users who do not have Telegram user names defined. You can get yours by contacting userinfobot.
  • CHANNEL_NAME: the name of a channel to relay affiliated links to. You must first add your bot as an admin for that channel. Feature added by adapting @nsniteshsahni's commit
String Replacement
{USER} The user that posted the message, as @username if they created a Telegram username, as first_name last_name otherwise.
{ORIGINAL_MESSAGE} The user's original message, with no replacements (so it will contain the non-affiliated Amazon link).
{MESSAGE} The user's message, with the affiliated Amazon link the bot created.

Running the app

You can either run the app directly through NodeJS

TELEGRAM_BOT_TOKEN=your-token AMAZON_TAG=your-tag node index.js

Or you can run it in Docker

docker run -e TELEGRAM_BOT_TOKEN=your-token -e AMAZON_TAG=your-tag --init lucatnt/telegram-bot-amazon

Note that the --init option is highly recommended because it allows you to stop the container through a simple Ctrl+C when running in the foreground. Without it you need to use docker stop.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].