Skip to content

feat: Components v2 #1760

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

Merged
merged 7 commits into from
May 4, 2025
Merged

feat: Components v2 #1760

merged 7 commits into from
May 4, 2025

Conversation

silasary
Copy link
Member

Pull Request Type

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

Description

Support for Components v2.
It's probably not perfect, but it works and I'm happy enough to ship it.

Changes

Related Issues

Test Scenarios

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

@AstreaTSS
Copy link
Member

AstreaTSS commented Apr 22, 2025

Before we merge this, I do want to say that we need to expose all of the new classes through the various __init.py__s.

@silasary silasary requested a review from AstreaTSS April 29, 2025 01:25
@silasary silasary changed the base branch from stable to unstable April 29, 2025 14:02
@silasary silasary enabled auto-merge (squash) May 1, 2025 06:47
@silasary silasary disabled auto-merge May 4, 2025 03:44
@silasary silasary merged commit 351322e into unstable May 4, 2025
12 of 15 checks passed
@silasary silasary deleted the components_v2 branch May 4, 2025 03:44
@fin-github
Copy link

Just got the error:

POST::https://discord.com/api/v10/interactions/1368954513607753829/aW50ZXJhY3Rpb246MTM2ODk1NDUxMzYwNzc1MzgyOTpHMWhPdXFCcXlQODV3d1Z5VEZ3eXJjYlNBZmJrS0pDSmdmYXkzZ3hqNHc0bmF2MVJFaVVNZGRDUmpHc2JlQXVSSXBkQ2FxSzlyTXg0bmlyaUx4dzhOd2NUT2o4RkxEbjJWMlVvQlNwRFRHdWNkMWRwdGhtSDNacFJJOUc3T2lXdQ/callback: 400
Ignoring exception in cmd `/v2`: HTTPException: 400|Bad Request: data->components->0 UNION_TYPE_CHOICES: Value of field "type" must be one of (1, 9, 10, 12, 13, 14, 17).

I have fixed it, but heres the result it sends if you want to make a more descriptive error for when this occurs.

Whenever you use a V1 component with a V2 component, it causes this error.

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.

4 participants