Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
1.框架基本完工
Browse files Browse the repository at this point in the history
  • Loading branch information
CaoMeiYouRen committed Jul 14, 2019
1 parent 54de113 commit 49e352a
Show file tree
Hide file tree
Showing 19 changed files with 3,422 additions and 291 deletions.
6 changes: 0 additions & 6 deletions dist/app/index.js

This file was deleted.

77 changes: 52 additions & 25 deletions dist/app/ltd.cmyr.demo/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
// import * as CQ from '../../bin/CQ.old'
const cq_robot_1 = require("cq-robot");
class LtdCmyrDemo extends cq_robot_1.CQApp {
class App extends cq_robot_1.CQApp {
constructor() {
super('ltd.cmyr.demo', __dirname);
this.CQ.setDebug(true);
Expand Down Expand Up @@ -33,52 +41,71 @@ class LtdCmyrDemo extends cq_robot_1.CQApp {
return 0;
}
privateMsg(subType, msgId, fromQQ, msg, font) {
if (fromQQ === 996881204) {
let res = `你发送了:${msg}`;
this.CQ.sendPrivateMsg(fromQQ, res);
}
return 0;
return __awaiter(this, void 0, void 0, function* () {
if (fromQQ === 996881204) {
this.CQ.sendPrivateMsg(fromQQ, `这是${this.APP_ID},你发送了:${msg}`);
}
return 1;
});
}
groupMsg(subType, msgId, fromGroup, fromQQ, fromAnonymous, msg, font) {
if (fromQQ === 996881204) {
this.CQ.sendGroupMsg(fromGroup, `${this.CQ.CQCode.at(fromQQ)}你发送了:${msg}`);
}
return 0;
return __awaiter(this, void 0, void 0, function* () {
if (fromQQ === 996881204) {
this.CQ.sendGroupMsg(fromGroup, `这是${this.APP_ID},你发送了:${msg}`);
}
return 0;
});
}
discussMsg(subType, msgId, fromDiscuss, fromQQ, msg, font) {
if (fromQQ === 996881204) {
this.CQ.send_discuss_msg(fromDiscuss, `${this.CQ.CQCode.at(fromQQ)}你发送了:${msg}`);
}
return 0;
return __awaiter(this, void 0, void 0, function* () {
if (fromQQ === 996881204) {
this.CQ.sendDiscussMsg(fromDiscuss, `这是${this.APP_ID},你发送了:${msg}`);
}
return 0;
});
}
groupUpload(subType, sendTime, fromGroup, fromQQ, file) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
groupAdmin(subType, sendTime, fromGroup, beingOperateQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
groupDecrease(subType, sendTime, fromGroup, fromQQ, beingOperateQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
groupIncrease(subType, sendTime, fromGroup, fromQQ, beingOperateQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
friendAdd(subType, sendTime, fromQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
requestAddFriend(subType, sendTime, fromQQ, msg, responseFlag) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
requestAddGroup(subType, sendTime, fromGroup, fromQQ, msg, responseFlag) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
}
const ltdCmyrDemo = new LtdCmyrDemo();
exports.ltdCmyrDemo = ltdCmyrDemo;
const app = new App(); //类名可以随意
exports.app = app;
/**
*仅在debug模式下执行,若不需要也可注释掉
*
*/
if (ltdCmyrDemo.CQ.getDebug()) {
ltdCmyrDemo.debug();
if (app.CQ.getDebug()) {
app.debug();
}
2 changes: 1 addition & 1 deletion dist/app/ltd.cmyr.demo/index.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": 21, // 事件类型
"name": "私聊消息处理", // 事件名称
"function": "privateMsg", // 事件对应函数
"priority": 30000 // 事件优先级(参见 cq.im/deveventpriority)
"priority": 20000 // 事件优先级(参见 cq.im/deveventpriority)
},
{
"id": 2,
Expand Down
81 changes: 56 additions & 25 deletions dist/app/ltd.cmyr.js.demo/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
// import * as CQ from '../../bin/CQ.old'
const cq_robot_1 = require("cq-robot");
// LtdCmyrJsDemo
class LtdCmyrJsDemo extends cq_robot_1.CQApp {
class App extends cq_robot_1.CQApp {
constructor() {
super('ltd.cmyr.js.demo', __dirname);
this.CQ.setDebug(true);
}
debug() {
this.privateMsg('test', 1, 996881204, '这是一条私聊消息', 1);
this.groupMsg('test', 1, 947983200, 996881204, '', '这是一条群消息', 1);
this.discussMsg('test', 1, 580771123, 996881204, '这是一条讨论组消息', 1);
}
startup() {
return 0;
Expand All @@ -25,52 +36,72 @@ class LtdCmyrJsDemo extends cq_robot_1.CQApp {
return 0;
}
privateMsg(subType, msgId, fromQQ, msg, font) {
if (fromQQ === 996881204) {
let res = '你发送了:' + msg;
this.CQ.sendPrivateMsg(fromQQ, res);
}
return 0;
return __awaiter(this, void 0, void 0, function* () {
if (fromQQ === 996881204) {
let res = `这是${this.APP_ID},你发送了:${msg}`;
this.CQ.sendPrivateMsg(fromQQ, res);
}
return 0;
});
}
groupMsg(subType, msgId, fromGroup, fromQQ, fromAnonymous, msg, font) {
if (fromQQ === 996881204) {
this.CQ.sendGroupMsg(fromGroup, this.CQ.CQCode.at(fromQQ) + '你发送了:' + msg);
}
return 0;
return __awaiter(this, void 0, void 0, function* () {
if (fromQQ === 996881204) {
this.CQ.sendGroupMsg(fromGroup, `这是${this.APP_ID},你发送了:${msg}`);
}
return 1;
});
}
discussMsg(subType, msgId, fromDiscuss, fromQQ, msg, font) {
if (fromQQ === 996881204) {
this.CQ.send_discuss_msg(fromDiscuss, this.CQ.CQCode.at(fromQQ) + '你发送了:' + msg);
}
return 0;
return __awaiter(this, void 0, void 0, function* () {
if (fromQQ === 996881204) {
this.CQ.send_discuss_msg(fromDiscuss, `这是${this.APP_ID},你发送了:${msg}`);
}
return 0;
});
}
groupUpload(subType, sendTime, fromGroup, fromQQ, file) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
groupAdmin(subType, sendTime, fromGroup, beingOperateQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
groupDecrease(subType, sendTime, fromGroup, fromQQ, beingOperateQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
groupIncrease(subType, sendTime, fromGroup, fromQQ, beingOperateQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
friendAdd(subType, sendTime, fromQQ) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
requestAddFriend(subType, sendTime, fromQQ, msg, responseFlag) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
requestAddGroup(subType, sendTime, fromGroup, fromQQ, msg, responseFlag) {
return 0;
return __awaiter(this, void 0, void 0, function* () {
return 0;
});
}
}
const ltdCmyrJsDemo = new LtdCmyrJsDemo();
exports.ltdCmyrJsDemo = ltdCmyrJsDemo;
const app = new App(); //类名可以随意
exports.app = app;
/**
*仅在debug模式下执行,若不需要也可注释掉
*
*/
if (ltdCmyrJsDemo.CQ.getDebug()) {
ltdCmyrJsDemo.debug();
if (app.CQ.getDebug()) {
app.debug();
}
2 changes: 1 addition & 1 deletion dist/app/ltd.cmyr.js.demo/index.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"type": 2,
"name": "群消息处理",
"function": "groupMsg",
"priority": 30000
"priority": 20000
},
{
"id": 3,
Expand Down
Loading

0 comments on commit 49e352a

Please sign in to comment.