/hacker-news-alert-chatgpt-discord

Summarize Hacker News Posts Using ChatGPT

Primary LanguageRust

Summarize Hacker News Posts Using ChatGPT -- Discord version

flows.network Discord flows.network Twitter Create a flow

Deploy this function on flows.network and receive hourly alerts with summarized Hacker News posts tailored to your interests.

image

You can also send the ChatGPT summary as a Slack Message.

How it works

This scheduled bot uses ChatGPT to summarize Hacker News posts. At the specified time, the bot searches for posts from the past hour, filters them based on your chosen keyword, and sends you a Discord message with a summary.

Deploy your own Hacker News summary bot in 3 steps

  1. Create a bot from a template
  2. Add your OpenAI API key
  3. Configure the bot on a specified Discord channel

0 Prerequisites

1 Create a bot from a template

Go to the Hacker News Alert ChatGPT Discord template.

Review the KEYWORD variable to specify your keyword of interest (supporting only one keyword for each bot).

Click on the Create and Build button.

2 Configure the bot to access Discord

Set up the Discord integration. Enter the discord_channel_id and discord_token to configure the bot. Click here to learn how to get a Discord channel id and Discord bot token.

  • discord_channel_id: Specify the channel where you want to deploy the bot. Copy and paste the final set of serial numbers from the discord channel's webpage URL.
  • discord_token: Get the Discord token from the Discord Developer Portal.
image

Click Continue.

2 Add your OpenAI API key

Set up the OpenAI integration. Click on Connect, and enter your key. The default key name is Default.

image

Close the tab and go back to the flow.network page once you are done. Finally, click Deploy.

Wait for the magic!

You are now on the flow details page and the flow function takes a few seconds to build. Once the flow's status changes to running, your bot is ready to summarize Hacker News posts.

FAQ

How to customize the bot's scheduled messaging time?

To customize the time when the bot sends Discord messages, you can modify the value in the cron expression ("37 * * * *"). This expression means the bot sends messages at the 37th minute of every hour.

    schedule_cron_job(String::from("37 * * * *"), keyword, callback).await;

To adjust the timing, you can change the number 37 to your desired minute. For example, if you want the messages to be sent at the 15th minute of every hour, you can modify the expression to be ("15 * * * *").

By customizing the cron expression, you can set the desired timing for the bot to send Discord messages.