codemaoapi
v1.1.2
Published
Collect apis from codemao
Downloads
36
Maintainers
Readme
CodemaoApi
这是一个nodejs的codemaoapi库,感谢Codemao api提供的文档
npm i codemaoapi
如何使用?
Codemao api
- 创建codemao
const _CodemaoApi = require('codemaoapi').CodemaoApi;
const codemao = new _CodemaoApi();
- 创建异步函数
async function main(){
// 将您的代码放入此处(每个codemao api都需要用await!)
await codemao.login('用户名','密码');
}
main()
.then(()=>{
console.log('运行完毕!');
})
.catch(console.err);
该api严格按照 bcmcreator的codemao api docs 所编写您可以直接从codemao api docs查看如何使用该模块
提供的api
- 登录
codemao.login(identity,password);
- 改用户信息、密码
codemao.changeInfo(info);
codemao.changePassword(old_password,password,confirm_password);
- 查个人消息、信息、帖子
codemao.findDetails();
codemao.findMessage();
codemao.findInfo();
codemao.findAllBoard();
codemao.findBoard(board_id);
codemao.findPost(post_id);
- 发布帖子、回复
codemao.addPost(content,board_id);
codemao.addReply(content,post_id);
codemao.replyReply(content,reply_id);
- 删除帖子
codemao.deletePost(post_id);
- 事件
codemao.event
|名称|介绍|参数| |:-:|:-:|:-:| |login|登录成功|登录返回值| |loginFailed|登录失败||
Box3 api
- 创建box3
const _Box3Api = require('codemaoapi').Box3Api;
const box3 = new _Box3Api();
提供的api
- 登录
box3.login(account,password)
- 查个人信息
box3.findInfo();
box3.findAvatorUploadTimes();
box3.findAvatorUrl();
- 事件
box3.event
|名称|介绍|参数| |:-:|:-:|:-:| |login|登录成功|登录返回值| |loginFailed|登录失败||
ForumText
- 创建ForunText
const ForumText = require('codemaoapi').ForumText;
// 创建帖子文本
var post_forum_text = new ForumText({
// 内容(必填)
text: '123',
// 颜色(选填)
color: 'black',
// 加粗(选填)
bold: false,
// 下划线(选填)
underline: true,
// 大小(选填)
size: 'medium',
// 位置(选填)
align: 'left'
});
// 使用默认参数
var post_forum_text2 = new ForumText(ForumText.defultOptions);
// 修改内容
post_forum_text2.options.text = '114514';
// 套娃
post_forum_text.options.text += post_forum_text2.content;
// 发布帖子时的内容
var post_content = post_forum_text.content;