This commit is contained in:
@ -2,6 +2,7 @@ import pkg from 'mirai-js';
|
|||||||
import { cookSubs, command } from '#root/config/index.js';
|
import { cookSubs, command } from '#root/config/index.js';
|
||||||
import { getRandomRecipe } from './api/index.js';
|
import { getRandomRecipe } from './api/index.js';
|
||||||
import { genRecipeMessage } from './utils/index.js';
|
import { genRecipeMessage } from './utils/index.js';
|
||||||
|
import logger from '#root/utils/logger.js'
|
||||||
|
|
||||||
const { Middleware } = pkg;
|
const { Middleware } = pkg;
|
||||||
const cookCommand = command.cook;
|
const cookCommand = command.cook;
|
||||||
@ -36,9 +37,11 @@ function cookInit() {
|
|||||||
'FriendMessage',
|
'FriendMessage',
|
||||||
new Middleware().friendFilter(cookSubs.users).done(dealCommon),
|
new Middleware().friendFilter(cookSubs.users).done(dealCommon),
|
||||||
);
|
);
|
||||||
|
logger('cook 初始化完成')
|
||||||
}
|
}
|
||||||
|
|
||||||
function dealCommon(data) {
|
function dealCommon(data) {
|
||||||
|
logger(data)
|
||||||
const [commandText, ...contentText] = data.text.trim().split(' ');
|
const [commandText, ...contentText] = data.text.trim().split(' ');
|
||||||
for (let com of cookCommand.keys()) {
|
for (let com of cookCommand.keys()) {
|
||||||
if (cookCommand[com].includes(commandText)) {
|
if (cookCommand[com].includes(commandText)) {
|
||||||
|
Reference in New Issue
Block a user