Skip to content

Commit f94a232

Browse files
committed
fix: 细节优化
1 parent 76282db commit f94a232

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/apps/update.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export const plugins = karin.command(/^#插件列表$/, async (e) => {
144144

145145
/** 更新插件 */
146146
export const updatePlugin = karin.command(/^#()?()?(.*)?$/, async (e) => {
147+
if (!e.isMaster) return false
147148
const [, all, force, name = 'node-karin'] = e.msg.match(/^#()?()?(.*)?$/)!
148149
const cmd = force ? 'git reset --hard && git pull --allow-unrelated-histories' : 'git pull'
149150
if (all) {
@@ -183,7 +184,7 @@ export const updatePlugin = karin.command(/^#(全部)?(强制)?更新(.*)?$/, as
183184
}
184185
return await e.reply(`\n更新成功\n${res.data}`, { at: true })
185186
}
186-
}, { name: '更新插件', perm: 'admin', priority: 100 })
187+
}, { name: '更新插件', priority: 100 })
187188
/** 检查更新 */
188189
export const check = karin.command(/^#/, async (e) => {
189190
let name = e.msg.replace(/^#/, '').trim()

0 commit comments

Comments
 (0)