Commit 7a2ce82b authored by nanahira's avatar nanahira

bump

parent 55cc6401
This diff is collapsed.
...@@ -44,11 +44,11 @@ ...@@ -44,11 +44,11 @@
"testEnvironment": "node" "testEnvironment": "node"
}, },
"dependencies": { "dependencies": {
"koishi-target-def": "^1.1.0", "koishi-target-def": "^1.1.1",
"node-schedule": "^2.1.0" "node-schedule": "^2.1.0"
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.7.1", "koishi": "^4.7.4",
"koishi-thirdeye": "^10.2.1" "koishi-thirdeye": "^10.2.1"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -22,13 +22,6 @@ export class BaseSchedulePlugin extends BasePlugin<SchedulePluginConfig> { ...@@ -22,13 +22,6 @@ export class BaseSchedulePlugin extends BasePlugin<SchedulePluginConfig> {
return ''; return '';
} }
isOneBotBot(bot?: Bot) {
return (
bot &&
(bot.platform === 'onebot' || bot['parentBot']?.platform === 'onebot')
);
}
async processSend() { async processSend() {
let message: string; let message: string;
this.logger.info(`Running schedule task...`); this.logger.info(`Running schedule task...`);
...@@ -45,13 +38,9 @@ export class BaseSchedulePlugin extends BasePlugin<SchedulePluginConfig> { ...@@ -45,13 +38,9 @@ export class BaseSchedulePlugin extends BasePlugin<SchedulePluginConfig> {
await Promise.all( await Promise.all(
this.config.targets.map(async (target) => { this.config.targets.map(async (target) => {
try { try {
let targetMessage = message;
const bot = this.bots.get(target.bot); const bot = this.bots.get(target.bot);
if (this.isOneBotBot(bot)) {
targetMessage = message.replace(/,url=base64/g, ',file=base64');
}
this.logger.debug(`Sending message from ${target.bot}.`); this.logger.debug(`Sending message from ${target.bot}.`);
const ids = await target.send(this.bots, targetMessage); const ids = await target.send(this.bots, message);
this.logger.debug( this.logger.debug(
`Message sent from ${target.bot}: ${ids?.join(',')}`, `Message sent from ${target.bot}: ${ids?.join(',')}`,
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment