@@ -109,6 +109,59 @@ def get_user_bots(self, user_id) -> HTTPResponse:
109
109
def get_widget_url (self , bot_id , style = 1 , ** query ) -> str :
110
110
return f'https://api.botlist.space/widget/{ bot_id } /{ style } ?{ _encode_query (query )} '
111
111
112
+ class BotsForDiscord (Service ):
113
+ """
114
+ Represents the Bots For Discord's service.
115
+
116
+ .. seealso::
117
+ `Service's API Documentation <https://docs.botsfordiscord.com/>`_
118
+ API Documentation for Bots For Discord
119
+ """
120
+
121
+ BASE_URL = 'https://botsfordiscord.com/api'
122
+
123
+ @staticmethod
124
+ def _post (
125
+ http_client , bot_id , token ,
126
+ server_count = 0 , user_count = 0 ,
127
+ voice_connections = 0 , shard_count = None ,
128
+ shard_id = None
129
+ ):
130
+ return http_client .request (
131
+ method = 'POST' ,
132
+ path = f'{ BotsForDiscord .BASE_URL } /bot/{ bot_id } ' ,
133
+ headers = { 'Authorization' : token },
134
+ json = { 'server_count' : server_count }
135
+ )
136
+
137
+ def get_bot (self , bot_id ) -> HTTPResponse :
138
+ return self ._request (
139
+ method = 'GET' ,
140
+ path = f'/bot/{ bot_id } '
141
+ )
142
+
143
+ def get_bot_votes (self , bot_id ) -> HTTPResponse :
144
+ return self ._request (
145
+ method = 'GET' ,
146
+ path = f'/bot/{ bot_id } /votes' ,
147
+ requires_token = True
148
+ )
149
+
150
+ def get_user (self , user_id ) -> HTTPResponse :
151
+ return self ._request (
152
+ method = 'GET' ,
153
+ path = f'/user/{ user_id } '
154
+ )
155
+
156
+ def get_user_bots (self , user_id ) -> HTTPResponse :
157
+ return self ._request (
158
+ method = 'GET' ,
159
+ path = f'/user/{ user_id } /bots'
160
+ )
161
+
162
+ def get_widget_url (self , bot_id , ** query ) -> str :
163
+ return f'{ BotsForDiscord .BASE_URL } /bot/{ bot_id } /widget?{ _encode_query (query )} '
164
+
112
165
class DiscordBotsGG (Service ):
113
166
"""
114
167
Represents the discord.bots.gg service.
@@ -236,6 +289,10 @@ def get_widget_url(self, bot_id, small_widget = None, **query) -> str:
236
289
'botlist.space' : BotListSpace ,
237
290
'bls' : BotListSpace ,
238
291
292
+ 'botsfordiscord' : BotsForDiscord ,
293
+ 'botsfordiscord.com' : BotsForDiscord ,
294
+ 'bfd' : BotsForDiscord ,
295
+
239
296
'discordbotsgg' : DiscordBotsGG ,
240
297
'discord.bots.gg' : DiscordBotsGG ,
241
298
'dbotsgg' : DiscordBotsGG ,
0 commit comments