Skip to content

feat: add new command to get user data#394

Merged
lucaspolo merged 1 commit intomainfrom
lucaspolo/add-user-command
Feb 13, 2026
Merged

feat: add new command to get user data#394
lucaspolo merged 1 commit intomainfrom
lucaspolo/add-user-command

Conversation

@lucaspolo
Copy link
Owner

This pull request adds a new feature to fetch and display Reddit user information via the Telegram bot, along with comprehensive tests for the new functionality. The main changes include implementing the user info fetcher, integrating a new /user command in the bot, and adding both unit and integration tests to ensure reliability.

New Reddit user info feature:

  • Added an asynchronous get_user_info function in reddit_crawler.py to fetch user details (name, karma, account age) from Reddit's API. [1] [2]
  • Introduced the /user command in the Telegram bot (user_info handler), which displays total karma and account age for a given Reddit username. [1] [2]

Testing improvements:

  • Added fixtures in tests/conftest.py to mock Reddit user API responses for both existing and non-existent users.
  • Implemented tests for get_user_info in test_crawler.py to verify correct data parsing and handling of not-found users. [1] [2]
  • Updated bot tests in test_bot.py to cover the /user command, including usage errors, valid responses, and not-found scenarios. [1] [2] [3]

@lucaspolo lucaspolo merged commit b0339b3 into main Feb 13, 2026
2 checks passed
@lucaspolo lucaspolo deleted the lucaspolo/add-user-command branch February 13, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments