Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/test: ensure polls are being correctly processed #1714

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

AstreaTSS
Copy link
Member

@AstreaTSS AstreaTSS commented Jun 30, 2024

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This PR goes in and fixes (hopefully) the remaining bugs present with polls. To ensure this is actually everything, I've gone ahead and added an extensive test suite to the bot specifically for polls.

Changes

  • Correctly serialize (not deserialize, oops) questions from Polls.
  • Use answer_id instead of option for the poll events.
  • Add test suite to test out poll objects.

Related Issues

Test Scenarios

export BOT_TOKEN="BOT_TOKEN"; pytest -k "test_polls" -vv
import interactions as ipy

@ipy.listen(ipy.events.MessagePollVoteAdd)  # and MessagePollVoteRemove
async def an_event(event: ipy.events.MessagePollVoteAdd):
    print(event.user_id)
    print(event.channel_id)
    print(event.message_id)
    print(event.answer_id)
    print(event.guild_id)

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@silasary silasary merged commit fcd8efe into interactions-py:unstable Jul 19, 2024
2 checks passed
@AstreaTSS AstreaTSS deleted the polls-test-and-fixes branch July 21, 2024 14:22
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.

2 participants