Refactor loadV2Plugin to use database plugins instead of passed plugins

This commit is contained in:
Kwaroran
2024-12-25 00:19:03 +09:00
parent 29c9f0ad15
commit b612d28f1b

View File

@@ -166,8 +166,9 @@ export async function loadV2Plugin(plugins:RisuPlugin[]){
risuFetch: globalFetch, risuFetch: globalFetch,
nativeFetch: fetchNative, nativeFetch: fetchNative,
getArg: (arg:string) => { getArg: (arg:string) => {
const db = getDatabase()
const [name, realArg] = arg.split('::') const [name, realArg] = arg.split('::')
for(const plug of plugins){ for(const plug of db.plugins){
if(plug.name === name){ if(plug.name === name){
return plug.realArg[realArg] return plug.realArg[realArg]
} }