一个简单的pythonapi包装器。

koreanbots的Python项目详细描述


PyPIPyPI - Python VersionGitHubPyPI - Downloads

A Simple Python API wrapper for KoreanBots.

文档

문서

安装“h2”

FiySun 3.6或者更多。

python3 -m pip install koreanbots
h2

koreanbots使用了PaySun的logging模块进行打底裤。

为了简单的调试,推荐{tt2}$以上的打底裤。

{tt1}$设定示例

importlogginglogger=logging.getLogger('koreanbots')logger.setLevel(logging.INFO)# DEBUG INFO WARNING ERROR CRITICALhandler=logging.StreamHandler()handler.setFormatter(logging.Formatter('[%(asctime)s] [%(filename)s] [%(name)s:%(module)s] [%(levelname)s]: %(message)s'))logger.addHandler(handler)
《h2》示例
更新

服务器数

定期更新机器人数量。(discord.py)

importdiscordimportkoreanbotsclient=discord.Client()Bot=koreanbots.Client(client,'KoreanBots 토큰')@client.eventasyncdefon_ready():print(f'{client.user}로 로그인하였습니다.')client.run('Discord 토큰')

导入ID机器人信息

discord.py 使用时

importdiscordimportkoreanbotsclient=discord.Client()Bot=koreanbots.Client(client,'KoreanBots 토큰')@client.eventasyncdefon_ready():print(f'{client.user}로 로그인하였습니다.')Data=awaitBot.getBot('653534001742741552')# 반환되는 데이터는 옆 링크를 참고해주세요: https://koreanbots.dev/js-sdk/interfaces/_types_.getbyid.htmlprint(Data)client.run('Discord 토큰')

discord.py 未使用时

importkoreanbotsimportasyncioloop=asyncio.get_event_loop()Bot=koreanbots.HTTPClient('KoreanBots 토큰')# getBot은 토큰이 필요하지 않기에 'KoreanBots 토큰' 부분은 생략 가능합니다.Data=loop.run_until_complete(Bot.getBot('653534001742741552'))# 반환되는 데이터는 옆 링크를 참고해주세요: https://koreanbots.dev/js-sdk/interfaces/_types_.getbyid.htmlprint(Data)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
javascript{“错误”:[“无效图像URL”]}与鸟舍集成   mysql Java语句。executeUpdate(sql)在executeQuery(sql)工作时不工作   在java中反复编辑object/arrayList   java在创建子类实例时是否也创建了超类实例?   如果运行一定次数,java是否仍要生成else?   java gradle eclipse依赖项,跳过testCompile/ProviderRuntime等   java如何用Dozer实例化子类?   java如何在docker容器中高效地构建maven项目?   lambda我想在这个块中转换成java 8流?   java本地广播管理器使用主活动未接收到的警报   更新产品数量时发生java异常(自定义属性)   java在每次迭代后删除2d数组的列和行   java如何在一个片段中存储数据以在另一个片段中获取数据?   java将默认公共构造函数添加到生成的生成器内部类