diff --git a/packages/plugin-common/src/index.ts b/packages/plugin-common/src/index.ts index 837768ed2c..47a089dc44 100644 --- a/packages/plugin-common/src/index.ts +++ b/packages/plugin-common/src/index.ts @@ -8,7 +8,6 @@ import echo from './echo' import exit from './exit' import help from './help' import info from './info' -import likeme, { LikemeOptions } from './likeme' import repeater, { RepeaterOptions } from './repeater' import requestHandler, { HandlerConfig } from './request-handler' import respondent, { Respondent } from './respondent' @@ -27,7 +26,6 @@ export { exit, help, info, - likeme, repeater, requestHandler, respondent, @@ -43,8 +41,6 @@ interface CommonPluginConfig extends HandlerConfig, AuthorizeConfig { exit?: false | CommandConfig help?: false | CommandConfig info?: false | CommandConfig - likeme?: false | LikemeOptions - rank?: false | CommandConfig repeater?: false | RepeaterOptions respondent?: Respondent[] welcome?: false | WelcomeMessage @@ -58,7 +54,6 @@ export function apply (ctx: Context, options: CommonPluginConfig = {}) { .plugin(echo, options.echo) .plugin(exit, options.exit) .plugin(help, options.help) - .plugin(likeme, options.likeme) .plugin(repeater, options.repeater) .plugin(requestHandler, options) .plugin(respondent, options.respondent) diff --git a/packages/plugin-common/src/likeme.ts b/packages/plugin-common/src/likeme.ts deleted file mode 100644 index df9332a089..0000000000 --- a/packages/plugin-common/src/likeme.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Context, getSenderName, CommandConfig, UserType } from 'koishi-core' - -export interface LikemeOptions extends CommandConfig { - likes?: UserType -} - -export default function apply (ctx: Context, config: LikemeOptions = {}) { - ctx.command('likeme', '让四季酱点赞', { maxUsage: 1, ...config }) - .alias('给我点赞') - .alias('为我点赞') - .action(async ({ meta }) => { - const times = typeof config.likes === 'function' ? config.likes(meta.$user) : config.likes ?? 10 - if (!times) return meta.$send(`${getSenderName(meta)},你的好感度过低,四季酱无法为你点赞。`) - try { - await ctx.sender.sendLike(meta.userId, times) - return meta.$send(`${getSenderName(meta)},四季酱已为你点赞 ${times} 次。`) - } catch (error) { - return meta.$send('操作时发生异常。') - } - }) -}