Commit 2be0176
🐛 make ComponentEmoji id and name optional (#91)
* fix: make ComponentEmoji id and name optional
Discord only includes the `id` field for custom emojis, not for standard
unicode emojis (e.g. 🔗). Defining `id` as required via `Field(...)` causes
pydantic ValidationError when receiving MESSAGE_UPDATE events containing
button components with unicode emojis.
Change both `id` and `name` to use `Missing[...] = UNSET` to match the
Discord API specification where both fields are optional in a partial emoji.
Fixes #90
* fix: make ComponentEmoji id and name optional
Discord only includes the id field for custom emojis, not for standard
unicode emojis (e.g. 🔗). Defining id as required via Field(...) causes
pydantic ValidationError when receiving MESSAGE_UPDATE events containing
button components with unicode emojis.
Change both id and
ame to use Missing[...] = UNSET to match the
Discord API specification where both fields are optional in a partial emoji.
Fixes #90
* fix: align ComponentEmoji with partial emoji schema
---------
Co-authored-by: shoucandanghehe <wallfjjd@gmail.com>1 parent 66ea530 commit 2be0176
2 files changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
641 | 641 | | |
642 | 642 | | |
643 | 643 | | |
644 | | - | |
| 644 | + | |
645 | 645 | | |
646 | | - | |
| 646 | + | |
647 | 647 | | |
648 | 648 | | |
649 | 649 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
138 | 158 | | |
139 | 159 | | |
140 | 160 | | |
| |||
0 commit comments