pw python包装器是一个小的python模块,用于连接jilk.pw的公共api。如果您想将您的不和谐服务器中的项目嵌入到与Python绑定的任何东西中,这将是有帮助的。
jilkpw-p的Python项目详细描述
jilk.pw python包装器
概述
关于
jilkpw_py
是一个小的python模块,用于连接到Jilk.pw的公共api。如果您希望将来自discord服务器的项嵌入到任何与python绑定的内容中,这会有所帮助。
什么是jilk.pw
jilk.pw是一个不和谐服务器列表,帮助您发现顶级的不和谐服务器;与可怕的公共不和谐服务器列表!
文档
安装
要安装jilkpw_py
,请在终端中输入以下命令:
pip3 install jilkpw_py
请注意,在某些系统上,python3可能只绑定到pip
&;而不是pip3
。
使用
要使用jilkpw_py
,请打开您的首选ide/text编辑器并输入以下内容:
获取特定列表
fromjilkpw_pyimportJilkpwWrapper# Import the classwrapper_name_here=JilkpwWrapper()# Initating an object under `jilkpw_py`dict_output=wrapper_name_here.find(478363034990149634)# Returns a dict for the given guild_id or throws an exeptionprint(dict_output)# Print the output to screen
获取所有列表
fromjilkpw_pyimportJilkpwWrapper# Import the classwrapper_name_here=JilkpwWrapper()# Initating an object under `jilkpw_py`dict_output=wrapper_name_here.all()# Returns a dict of all servers on jilkpw or throws an exeptionprint(dict_output)# Print the output to screen
注意
fromjilkpw_pyimportJilkpwWrapper# Import the classwrapper_name_here=JilkpwWrapper()# Initating an object under `jilkpw_py`dict_output=wrapper_name_here.all()# Returns a dict of all servers on jilkpw or throws an exeptionprint(dict_output)# Print the output to screen
注意
这将给出jilkpw_py
的基本实现,但是正如您在下面看到的,您必须捕获各种错误(提示:在dict_output = wrapper_name_here.find(478363034990149634)
行周围尝试/排除)。
异常
http错误
NotFound
:jilk.pw找不到您传入的公会IDBadRequest
:对jilk.pw的请求处理不正确&已中止NotAuthed
:无论出于什么原因,您都无权使用jilk.pw的公共apiWebMoved
:jilk.pw移动了WebTimeout
:请求jilk.pw超时,请稍后再试UriTooLong
:uri太长,服务器无法处理MiscError
:http响应代码是x
(不包括200或以前使用过的)
其他错误
CannotMain
:如果您试图直接运行模块