8 points by discord_botfan 6 months ago flag hide 26 comments
user1 6 months ago next
This is really cool! How did you handle rate limiting with the Discord API?
creator 6 months ago next
I implemented a simple rate limiter using the token bucket algorithm. It's not perfect but it has been working well so far.
user2 6 months ago prev next
Do you have any plans to expand this to other communities or platforms?
creator 6 months ago next
Yes, I have been thinking about adding support for Reddit. I think the approach would be similar since they also have a rate limit.
user3 6 months ago prev next
I really like the idea of this. I'm going to try and run this on my own server. Do you have any documentation on how to do so?
creator 6 months ago next
I do have some basic setup and installation instructions in the README. If you can't find the answer to your question there, feel free to open an issue and I'll be happy to help.
user4 6 months ago prev next
How does the bot decide which posts to share? Does it just take all popular stories?
creator 6 months ago next
Currently, the bot only shares new stories that reach a certain number of points. I am planning on adding more filters and configuration options in the future.
user5 6 months ago prev next
How do you parse the comments and submit them to Discord? Do you just copy the raw text or do you format it in some way?
creator 6 months ago next
I parse the raw HTML for each comment and extract the relevant information. I do some basic formatting to make it easier to read, like adding line breaks and indentation. I also convert all of the markdown to plain text.
user6 6 months ago prev next
What library do you use for the Discord API? Is there a specific reason you chose it?
creator 6 months ago next
I am using discord.js. I chose it because it's actively maintained and has a large community of users. There is a lot of documentation and support available, which made it easier to get started.
user7 6 months ago prev next
This is a really interesting project! Have you considered adding support for other programming languages or frameworks?
creator 6 months ago next
I have not considered adding support for other programming languages or frameworks, but it is a good idea. I will definitely keep it in mind for the future.
user8 6 months ago prev next
I notice that some of the usernames are rather nonsensical, like a random string of characters. Why is that?
creator 6 months ago next
Those are people who have enabled two-factor authentication for their Discord account. The non-sensical username is a security feature meant to protect the account.
user9 6 months ago prev next
Is there any way to get notified when a new post hits the front page? I would love to be able to use this to keep track of the latest HN stories.
creator 6 months ago next
Currently, the bot does not support notifications. I have been thinking about adding this feature, but I'm trying to prioritize the stability and reliability of the bot first. I will add it to my list of potential features for the future.
user10 6 months ago prev next
Do you plan on adding support for the official Hacker News API in the future?
creator 6 months ago next
I do plan to add support for the official Hacker News API in the future. It would give me more flexibility and control over the stories that the bot shares. However, it's not something that I'm currently working on, so I can't give an estimated time for when it will be ready.
user11 6 months ago prev next
This is really cool! I built something similar for the top Reddit stories. Do you have any plans to merge the projects and create a super bot?
creator 6 months ago next
I had not considered merging the projects, but it is an interesting idea! I will definitely keep it in mind for the future. For now, however, I am going to focus on adding more features and improving the stability of the bot.
user12 6 months ago prev next
Do you have any plans to add support for HTTPS push notifications instead of using the Discord API? I think it would make the bot more responsive and reduce the latency.
creator 6 months ago next
I have considered adding support for HTTPS push notifications, but I have not decide whether or not I will. There are a few downsides, like increased complexity and maintenance. I will have to evaluate the pros and cons before I decide whether or not to implement it.
user13 6 months ago prev next
I really like the idea of this, but I'm not sure if I want to run it on my own server. Do you have any plans to publish this as a managed service?
creator 6 months ago next
I do not have any plans to publish this as a managed service at this time. There are a lot of considerations and challenges involved, like handling payments, data security, and scaling. I will consider it in the future, but it's not something I can commit to at the moment.