Commit 0d48282
authored
Deprecate
This deprecates `GuildChannel::permissions_for_user` as:
- It is unnecessary API surface
- Performs a cache lookup when most users will have `Guild` if they have
`GuildChannel`
It also adds `Message::author_permissions` to match
`Interaction::permissions` and hopefully be a replacement for a lot of
the usage of `GuildChannel::permissions_for_user`. This also takes
advantage of the lesser known `Message::member` field to not require
member intents for calculating the permissions from a message create
event.
For `Message::author_permissions`, this also adds
`Permissions::dm_permissions`, which returns the permissions that are
implicitly enabled in a DM.Guild::permissions_for_user, add Message::author_permissions1 parent 85df0b0 commit 0d48282
File tree
5 files changed
+51
-18
lines changed- examples/testing/src
- src
- framework/standard
- model
- channel
5 files changed
+51
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 199 | + | |
205 | 200 | | |
206 | 201 | | |
207 | 202 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
857 | 857 | | |
858 | 858 | | |
859 | 859 | | |
| 860 | + | |
| 861 | + | |
860 | 862 | | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
| 863 | + | |
867 | 864 | | |
868 | 865 | | |
869 | 866 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| 764 | + | |
764 | 765 | | |
765 | 766 | | |
766 | 767 | | |
| |||
1022 | 1023 | | |
1023 | 1024 | | |
1024 | 1025 | | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1030 | 1029 | | |
1031 | | - | |
| 1030 | + | |
1032 | 1031 | | |
1033 | 1032 | | |
1034 | 1033 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
219 | 239 | | |
220 | 240 | | |
221 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
423 | 445 | | |
424 | 446 | | |
425 | 447 | | |
| |||
0 commit comments