@@ -92,7 +92,10 @@ def parse_bot_dict(d: dict) -> dict:
92
92
data ["owners" ] = [int (e ) for e in owners ]
93
93
94
94
# TODO: remove this soon
95
- data ["guilds" ] = []
95
+ data .pop ("defAvatar" , None )
96
+ data .pop ("discriminator" , None )
97
+ data .pop ("guilds" , None )
98
+ data .pop ("certifiedBot" , None )
96
99
97
100
for key , value in data .copy ().items ():
98
101
converted_key = camel_to_snake (key )
@@ -106,6 +109,10 @@ def parse_bot_dict(d: dict) -> dict:
106
109
def parse_user_dict (d : dict ) -> dict :
107
110
data = d .copy ()
108
111
112
+ # TODO: remove this soon
113
+ data .pop ("discriminator" , None )
114
+ data .pop ("certifiedDev" , None )
115
+
109
116
data ["social" ] = SocialData (** data .get ("social" , {}))
110
117
111
118
return data
@@ -205,15 +212,9 @@ class BotData(DataDict[str, t.Any]):
205
212
username : str
206
213
"""The username of the bot."""
207
214
208
- discriminator : str
209
- """The discriminator of the bot."""
210
-
211
215
avatar : t .Optional [str ]
212
216
"""The avatar hash of the bot."""
213
217
214
- def_avatar : t .Optional [str ]
215
- """The avatar hash of the bot's default avatar."""
216
-
217
218
prefix : str
218
219
"""The prefix of the bot."""
219
220
@@ -238,18 +239,12 @@ class BotData(DataDict[str, t.Any]):
238
239
owners : t .List [int ]
239
240
"""The IDs of the owners of the bot."""
240
241
241
- guilds : t .List [int ]
242
- """The guilds the bot is in."""
243
-
244
242
invite : t .Optional [str ]
245
243
"""The invite URL of the bot."""
246
244
247
245
date : datetime
248
246
"""The time the bot was added."""
249
247
250
- certified_bot : bool
251
- """Whether or not the bot is certified."""
252
-
253
248
vanity : t .Optional [str ]
254
249
"""The vanity URL of the bot."""
255
250
@@ -265,6 +260,45 @@ class BotData(DataDict[str, t.Any]):
265
260
def __init__ (self , ** kwargs : t .Any ):
266
261
super ().__init__ (** parse_bot_dict (kwargs ))
267
262
263
+ @property
264
+ def def_avatar (self ) -> t .Optional [str ]:
265
+ """DEPRECATED: def_avatar is no longer supported by Top.gg API v0. At the moment, this will always be None."""
266
+
267
+ warnings .warn (
268
+ "def_avatar is no longer supported by Top.gg API v0. At the moment, this will always be None." ,
269
+ DeprecationWarning ,
270
+ )
271
+
272
+ @property
273
+ def discriminator (self ) -> str :
274
+ """DEPRECATED: Discriminators are no longer supported by Top.gg API v0. At the moment, this will always be '0'."""
275
+
276
+ warnings .warn (
277
+ "Discriminators are no longer supported by Top.gg API v0. At the moment, this will always be '0'." ,
278
+ DeprecationWarning ,
279
+ )
280
+ return "0"
281
+
282
+ @property
283
+ def guilds (self ) -> t .List [int ]:
284
+ """DEPRECATED: Guilds list is no longer supported by Top.gg API v0. At the moment, this will always be an empty list."""
285
+
286
+ warnings .warn (
287
+ "Guilds list is no longer supported by Top.gg API v0. At the moment, this will always be an empty list." ,
288
+ DeprecationWarning ,
289
+ )
290
+ return []
291
+
292
+ @property
293
+ def certified_bot (self ) -> bool :
294
+ """DEPRECATED: Certified bot is no longer supported by Top.gg API v0. At the moment, this will always be false."""
295
+
296
+ warnings .warn (
297
+ "Certified bot is no longer supported by Top.gg API v0. At the moment, this will always be false." ,
298
+ DeprecationWarning ,
299
+ )
300
+ return False
301
+
268
302
269
303
class BotStatsData (DataDict [str , t .Any ]):
270
304
"""Model that contains information about a listed bot's guild count."""
@@ -279,20 +313,21 @@ def __init__(self, **kwargs: t.Any):
279
313
280
314
@property
281
315
def shards (self ) -> t .List [int ]:
282
- """DEPRECATED: No longer supported by Top.gg API v0. At the moment, this will always return an empty array."""
316
+ """DEPRECATED: Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return an empty array."""
283
317
284
318
warnings .warn (
285
- "No longer supported by Top.gg API v0. At the moment, this will always return an empty array." ,
319
+ "Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return an empty array." ,
286
320
DeprecationWarning ,
287
321
)
288
322
return []
289
323
290
324
@property
291
325
def shard_count (self ) -> t .Optional [int ]:
292
- """DEPRECATED: No longer supported by Top.gg API v0. At the moment, this will always return None."""
326
+ """DEPRECATED: Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return None."""
293
327
294
328
warnings .warn (
295
- "No longer supported by Top.gg API v0. At the moment, this will always return None." , DeprecationWarning
329
+ "Shard-related data is no longer supported by Top.gg API v0. At the moment, this will always return None." ,
330
+ DeprecationWarning ,
296
331
)
297
332
298
333
@@ -343,9 +378,6 @@ class UserData(DataDict[str, t.Any]):
343
378
username : str
344
379
"""The username of the user."""
345
380
346
- discriminator : str
347
- """The discriminator of the user."""
348
-
349
381
social : SocialData
350
382
"""The social data of the user."""
351
383
@@ -355,9 +387,6 @@ class UserData(DataDict[str, t.Any]):
355
387
supporter : bool
356
388
"""Whether or not the user is a supporter."""
357
389
358
- certified_dev : bool
359
- """Whether or not the user is a certified dev."""
360
-
361
390
mod : bool
362
391
"""Whether or not the user is a Top.gg mod."""
363
392
@@ -370,6 +399,26 @@ class UserData(DataDict[str, t.Any]):
370
399
def __init__ (self , ** kwargs : t .Any ):
371
400
super ().__init__ (** parse_user_dict (kwargs ))
372
401
402
+ @property
403
+ def certified_dev (self ) -> bool :
404
+ """DEPRECATED: Certified dev is no longer supported by Top.gg API v0. At the moment, this will always be False."""
405
+
406
+ warnings .warn (
407
+ "Certified dev is no longer supported by Top.gg API v0. At the moment, this will always be False." ,
408
+ DeprecationWarning ,
409
+ )
410
+ return False
411
+
412
+ @property
413
+ def discriminator (self ) -> str :
414
+ """DEPRECATED: Discriminators are no longer supported by Top.gg API v0. At the moment, this will always be '0'."""
415
+
416
+ warnings .warn (
417
+ "Discriminators are no longer supported by Top.gg API v0. At the moment, this will always be '0'." ,
418
+ DeprecationWarning ,
419
+ )
420
+ return "0"
421
+
373
422
374
423
class VoteDataDict (DataDict [str , t .Any ]):
375
424
"""Base model that represents received information from Top.gg via webhooks."""
0 commit comments