Commit b9bfe00
feat: Implement better get_or_fetch (#2776)
* Update CHANGELOG.md
Signed-off-by: Lumouille <[email protected]>
* add a get or fetch to guild
Signed-off-by: Lumouille <[email protected]>
* Implement better get_or_fetch using typevar and object
Signed-off-by: Lumouille <[email protected]>
* shortcut for get or fetch
Signed-off-by: Lumouille <[email protected]>
* Update CHANGELOG.md
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* usage of subclass
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* add get_emoji method
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* add get_or_fetch_emoji method
Signed-off-by: Lumouille <[email protected]>
* shortcut getorfetch client + removal of get_or_fetch user in favor of get_or_fetch shortcut
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update utils.py
Signed-off-by: Lumouille <[email protected]>
* Update guild.py
Signed-off-by: Lumouille <[email protected]>
* Update client.py
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update utils.py
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* add utils.deprecated
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* add warning
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update client.py
Signed-off-by: Lumouille <[email protected]>
* added backward support
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* fixed missing coma
Signed-off-by: Lumouille <[email protected]>
* ig im drunk
Signed-off-by: Lumouille <[email protected]>
* fix my drunkness
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* now im not drunk
Signed-off-by: Lumouille <[email protected]>
* Update utils.py
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update utils.py
Signed-off-by: Lumouille <[email protected]>
* Update utils.py
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* usage of abc
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* _EmojiTag
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update utils.py
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update utils.py
Signed-off-by: Lumouille <[email protected]>
* Update discord/client.py
Co-authored-by: plun1331 <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* add the raise error
Signed-off-by: Lumouille <[email protected]>
* Update discord/utils.py
Co-authored-by: plun1331 <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update utils.pyfix missing appemoji
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* add missing raise to doc
* refactor: add TODO comments for removal of deprecated arguments in get_or_fetch_user and get_or_fetch
* refactor: move _FETCHABLE type variable to utils for better accessibility
* fix: update import statement for _FETCHABLE from utils module
* refactor: streamline get_or_fetch logic with a mapping for object types
* fix: add validation for Guild type in get_or_fetch function
* fix: correct base type resolution in get_or_fetch function
* fix: add Role type support in get_or_fetch function
* fix: update role retrieval methods in get_or_fetch function
* Update CHANGELOG.md
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update CHANGELOG.md
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update CHANGELOG.md
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update CHANGELOG.md
Co-authored-by: Paillat <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* feat: update get_or_fetch method to accept Optional[int] for object_id
* fix: "MISSING" not being exported
* add some more comment
* Update utils.py
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update discord/utils.py
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update discord/utils.py
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* comment
* style(pre-commit): auto fixes from pre-commit.com hooks
* fix docs
* Update discord/client.py
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* usage of literal None
* style(pre-commit): auto fixes from pre-commit.com hooks
* return None when fetching fails
* style(pre-commit): auto fixes from pre-commit.com hooks
* back to non breaking
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update discord/utils.py
Co-authored-by: Paillat <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update CHANGELOG.md
* style(pre-commit): auto fixes from pre-commit.com hooks
* paillat suggestions, in test
* fix bug invalid data unhandle
* style(pre-commit): auto fixes from pre-commit.com hooks
* style(pre-commit): auto fixes from pre-commit.com hooks
* style(pre-commit): auto fixes from pre-commit.com hooks
* fix: changelog entry position
Signed-off-by: Lala Sabathil <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* docs rewrits
* Update guild.py
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update guild.py
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update utils.py
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update CHANGELOG.md
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update discord/client.py
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* fix copilot mistakes
* fix
* style(pre-commit): auto fixes from pre-commit.com hooks
* usage of type for specification
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update discord/utils.py
Co-authored-by: Soheab <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* fix: 🐛 Prevent `InvalidArgument` for `AppEmoji` in `get_or_fetch` method
* fix: 🐛 Import `AppEmoji` in `get_or_fetch` to resolve potential issues
* style(pre-commit): auto fixes from pre-commit.com hooks
* Update CHANGELOG.md
Co-authored-by: Paillat <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* Update utils.py
Co-authored-by: Paillat <[email protected]>
Signed-off-by: Lumouille <[email protected]>
* style(pre-commit): auto fixes from pre-commit.com hooks
* fix: 🐛 Import `AppEmoji` in `_get_string_to_type_map` for type mapping
* style(pre-commit): auto fixes from pre-commit.com hooks
---------
Signed-off-by: Lumouille <[email protected]>
Signed-off-by: Lala Sabathil <[email protected]>
Signed-off-by: Soheab <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: plun1331 <[email protected]>
Co-authored-by: Paillat <[email protected]>
Co-authored-by: Lala Sabathil <[email protected]>
Co-authored-by: Soheab <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Paillat <[email protected]>1 parent 40656fd commit b9bfe00
4 files changed
+363
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
57 | 59 | | |
58 | 60 | | |
59 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
60 | 68 | | |
61 | 69 | | |
62 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
| |||
61 | 69 | | |
62 | 70 | | |
63 | 71 | | |
64 | | - | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
71 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
72 | 87 | | |
73 | 88 | | |
74 | 89 | | |
75 | 90 | | |
76 | 91 | | |
| 92 | + | |
77 | 93 | | |
78 | 94 | | |
79 | 95 | | |
| |||
1165 | 1181 | | |
1166 | 1182 | | |
1167 | 1183 | | |
1168 | | - | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1169 | 1190 | | |
1170 | 1191 | | |
1171 | 1192 | | |
| |||
1181 | 1202 | | |
1182 | 1203 | | |
1183 | 1204 | | |
1184 | | - | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1185 | 1248 | | |
1186 | 1249 | | |
1187 | 1250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
1041 | 1042 | | |
1042 | 1043 | | |
1043 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
1044 | 1088 | | |
1045 | 1089 | | |
1046 | 1090 | | |
| |||
3012 | 3056 | | |
3013 | 3057 | | |
3014 | 3058 | | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
| 3065 | + | |
| 3066 | + | |
| 3067 | + | |
| 3068 | + | |
| 3069 | + | |
| 3070 | + | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
3015 | 3079 | | |
3016 | 3080 | | |
3017 | 3081 | | |
| |||
0 commit comments