Skip to content

lawxls/HackerNews-Alerts-Bot

Repository files navigation

HackerNews Alerts Bot

Telegram-bot

Telegram bot for all kinds of notifications from Hacker News

Test pre-commit


commands


Features:

Keyword Monitoring

Create a personal feed of stories or monitor mentions of your brand, projects, or topics you're interested in.

Screenshot_11 Screenshot_12

To set up monitoring of story titles and comment bodies, simply add a keyword via the /add command: /add python

To monitor only story titles, use the -stories option: /add python -stories

In addition, the /set_score command can be used to receive stories only if they meet a specified score threshold (set to 1 by default).

Keyword search is implemented via a case-insensitive containment test.

Follow Users

Follow a user to get notified of new posts and/or comments.

Use the /follow command to receive notifications when a user posts a new story or comment: /follow hnuser123

Use the -stories or -comments option to monitor only stories or comments: /follow hnuser123 -stories

Subscribe to a Thread

Receive an alert when a new comment appears in a thread.

Screenshot_60

Subscribe to a thread by ID: /subscribe 34971530

Screenshot_62

Stories by Domain Names

Add domain names to receive alerts whenever new stories are submitted.

Add a domain name: /watch example.com

Stories are affected by the /set_score command.

Comment Replies

Receive notifications when someone replies to one of your comments.

Add your username: /notify hnuser123

COMMANDS

Keyword Monitoring

  • Add a Keyword

    /add KEYWORD [-whole-word, -stories, -comments]

    If no options are specified, the bot will monitor both story titles and comments.

    Options:

    • -whole-word to match the entire word

    • -stories to monitor only thread titles

    • -comments to monitor only comments

    Examples:

    • /add project-name

    • /add python -stories

    • /add AI -whole-word -stories

    • /add machine learning -stories

  • Set a Score Threshold

    /set_score SCORE

    Receive stories only if they meet a specified score threshold (set to 1 by default).

  • List Keywords

    /keywords

  • Remove a Keyword

    /remove KEYWORD

Follow Users

  • Follow a User

    /follow USERNAME [-stories, -comments]

    If no options are specified, the bot will monitor new stories and comments.

    Options:

    • -stories to monitor only new stories

    • -comments to monitor only comments

    Examples:

    • /follow hnuser123

    • /follow hnuser123 -stories

  • List Followed Users

    /followed_users

  • Unfollow a User

    /unfollow USERNAME

Subscribe to a Thread

  • Subscribe to a Thread

    /subscribe ID

  • List Subscriptions

    /subscriptions

  • Unsubscribe from a Thread

    /unsubscribe ID

Stories by Domain Names

  • Follow a Domain Name

    /watch DOMAIN NAME

  • List Domain Names

    /domains

  • Unfollow a Domain Name

    /abandon DOMAIN NAME

Comment Replies

  • Add a Username

    /notify USERNAME

  • Disable Notifications

    /disable

General Commands

  • General Info

    /help

  • List of Commands

    /commands

  • Contacts

    /contacts

  • Stop the Bot and Delete Your Data

    /stop