优化 #留影叙佳期 的处理

This commit is contained in:
SmallK111407 2023-08-31 16:37:30 +08:00
parent 37f485a6c1
commit 0d636f09e4
1 changed files with 22 additions and 21 deletions

View File

@ -7,14 +7,11 @@ export class takeBirthdayPhoto extends plugin {
super({ super({
name: '留影叙佳期', name: '留影叙佳期',
dsc: '留影叙佳期', dsc: '留影叙佳期',
/** https://oicqjs.github.io/oicq/#events */
event: 'message', event: 'message',
priority: 5000, priority: 5000,
rule: [ rule: [
{ {
/** 命令正则匹配 */ reg: '#?留影(叙|徐)(佳|假)期$',
reg: '#?留影叙佳期$',
/** 执行方法 */
fnc: 'birthdaystar' fnc: 'birthdaystar'
} }
] ]
@ -46,7 +43,7 @@ export class takeBirthdayPhoto extends plugin {
e.reply('今天没有生日角色哦~', true) e.reply('今天没有生日角色哦~', true)
return true return true
} }
try {
for (const role of birthday_star_list) { for (const role of birthday_star_list) {
await e.reply(`正在获取${role.name}的图片,请稍等~`, true) await e.reply(`正在获取${role.name}的图片,请稍等~`, true)
await e.reply(segment.image(role.take_picture)) await e.reply(segment.image(role.take_picture))
@ -58,6 +55,10 @@ export class takeBirthdayPhoto extends plugin {
await e.reply(`获取${role.name}的图片成功~`, true) await e.reply(`获取${role.name}的图片成功~`, true)
} }
} }
} catch (error) {
await e.reply(`获取角色留影叙佳期图片失败可能是ck失效...`)
logger.error(error)
}
return true return true
} }