Commit 9307f07
fix: serve a default avatar for users with no custom avatar (#33)
Originally proposed by @paring-chan. The null-safety part of the
original PR is already handled differently on main; this commit ports
just the default-avatar fallback so every user gets a usable avatar_url
in the response.
Discord's defaults are:
- discriminator-era users: embed/avatars/{discriminator % 5}.png
- new username system (discriminator '0'): embed/avatars/{(user_id >> 22) % 6}.png
Co-authored-by: Androz2091 <androz2091@gmail.com>
Co-authored-by: 파링 <paring@email>1 parent f9ef112 commit 9307f07
1 file changed
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
311 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
312 | 324 | | |
313 | 325 | | |
314 | 326 | | |
| |||
0 commit comments