fanbook bot api
Project description
开始使用
这里使用getme做示例
import fanbookbotapi
print(fanbookbotapi.getme('123').text)
1.2.2更改:发送消息函数添加参数add_Key,为了防止不添加键盘时消息出现边框,如果你需要添加键盘,请将其设置为True,否则不用管
支持的api
- getme(token='bot token')
获取bot的信息
- sendmessage(token='',chatid=0,biaoti="标题",ik=[[{"text":"下一页","callback_data":"{"type":"next","index":2,"msg":"114514"}"}]],text='文本',biaoticolor='ffe4e4',type="card",shade=['ff764a','ffb39aff'],backgroundColor='ddeeff00',getjson=False) -> requests.models.Response|str:
发送消息
Args:
token (str, optional): botToken. Defaults to ''.
chatid (int, optional): 频道id. Defaults to 0.
biaoti (str, optional): 卡片标题. Defaults to "标题".
ik (list, optional): 自定义键盘. Defaults to [[{"text":"下一页","callback_data":"{\"type\":\"next\",\"index\":2,\"msg\":\"114514\"}"}]].
text (str, optional): 正文内容,如果是card模式,换行符为 4个反斜线n. Defaults to '文本'.
biaoticolor (str, optional): 弃用,默认即可. Defaults to 'ffe4e4'.
type (str, optional): card(内置卡片)/fanbook(特殊消息解析模式)/text(纯文本). Defaults to "card".
shade (list, optional): 标题背景颜色,如果配置两项就是渐变色. Defaults to ['ff764a','ffb39aff'].
backgroundColor (str, optional): 标题文本颜色. Defaults to 'ddeeff'.
getjson (bool, optional): 设置为True就是只返回编码完成的json,不请求. Defaults to False.
add_Key (bool, optional): 是否添加键盘. Defaults to False.
Returns:
requests.models.Response|str: requests请求对象|编码完成的json
token (str): botToken
sendmessage(token='',chatid=0,biaoti="标题",ik=[[{"text":"下一页","callback_data":"{\"type\":\"next\",\"index\":2,\"msg\":\"114514\"}"}]],text='文本',biaoticolor='ffe4e4',type="card",shade=['ff764a','ffb39aff'],backgroundColor='ddeeff00',getjson=False) -> requests.models.Response|str:
- getPrivateChat(token,userid)
创建私聊频道
Args:
token (str): botToken
userid (int): 用户长id
Returns:
requests.models.Response: requests请求对象
{"ok":true,"result":{"id":510639729457618944,"guild_id":0,"type":"private","channel_type":3}}
返回中,id代表频道id
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fanbookbotapi-1.2.2.tar.gz
(3.7 kB
view details)
Built Distribution
File details
Details for the file fanbookbotapi-1.2.2.tar.gz
.
File metadata
- Download URL: fanbookbotapi-1.2.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8bfddc47686ceb21a03042096cc8611a4efb9b1bee825bd8c15563410a3f90c |
|
MD5 | 269b57e0b95b51ca903785137490acc2 |
|
BLAKE2b-256 | 9dd19229cc7abaa3af6bfe989558f3e1041171dc4324befdc31dd2a5427fd0b2 |
File details
Details for the file fanbookbotapi-1.2.2-py3-none-any.whl
.
File metadata
- Download URL: fanbookbotapi-1.2.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2593798c6485ee7aaec313620ff5d685c9a2b96d52ad1583b5071ee2c1f2b34c |
|
MD5 | 966f7c296255e57b534695a9f3152cb1 |
|
BLAKE2b-256 | 5f3ba8d7f4d5600138bbb2eff540c0f68d0ad0322cd95708f4b1c80e5e8cf1e5 |