mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-25 01:21:55 +00:00
commit
b81ea80939
46
main.js
46
main.js
@ -1,27 +1,21 @@
|
|||||||
import { createApps } from 'alemonjs'
|
import { createApp } from 'alemonjs'
|
||||||
import { apps } from './index.js'
|
import { apps } from './index.js'
|
||||||
const app = createApps(import.meta.url)
|
/**
|
||||||
const arg = /^#?(\*|星铁|星轨|穹轨|星穹|崩铁|星穹铁道|崩坏星穹铁道|铁道)+/
|
* *******
|
||||||
app.setMessage(async e => {
|
* 创建应用 createApp
|
||||||
e.isSr = true
|
* 重定义 reSetEvent
|
||||||
e.isGs = true
|
* 切割消息 replace
|
||||||
await runtime.init(e)
|
* 使用 use
|
||||||
Object.defineProperty(e, 'isSr', {
|
* 挂载 mount
|
||||||
get: () => e.game === 'sr',
|
* *******
|
||||||
set: (v) => { e.game = v ? 'sr' : 'gs' }
|
* global.YUNZAI_GENSHIN 原神星铁重定义方法 | 方便A崽统一修改
|
||||||
})
|
* global.YUNZAI_EVENT 非原神星铁相关的重定义方法 | 方便A崽统一修改
|
||||||
Object.defineProperty(e, 'isGs', {
|
* global.YUNZAI_REG 星铁消息的正则变量
|
||||||
get: () => e.game === 'gs',
|
* *******
|
||||||
set: (v) => { e.game = v ? 'gs' : 'sr' }
|
*/
|
||||||
})
|
createApp(import.meta.url)
|
||||||
if (arg.test(e.msg)) {
|
.reSetEvent(global.YUNZAI_GENSHIN)
|
||||||
e.game = 'sr'
|
.replace(global.YUNZAI_REG,'#星铁')
|
||||||
e.msg = e.msg.replace(arg, '#星铁')
|
.replace(/^(\/|#)/,'#')
|
||||||
}
|
.use(apps)
|
||||||
e.sender = {}
|
.mount()
|
||||||
e.sender.card = e.user_name
|
|
||||||
return e
|
|
||||||
})
|
|
||||||
app.setCharacter('#')
|
|
||||||
app.component(apps)
|
|
||||||
app.mount()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user