1- import { makeDefaults } from "../../ lib/utility" ;
1+ import { makeDefaults } from "~ lib/utility" ;
22
33import fluxDispatchPatch from "./patches/flux_dispatch" ;
44import selfEditPatch from "./patches/self_edit" ;
@@ -9,14 +9,15 @@ import updateMessageRecord from "./patches/updateMessageRecord";
99
1010import { FluxDispatcher } from "@vendetta/metro/common" ;
1111import { storage , id } from "@vendetta/plugin" ;
12- import { plugin } from "@vendetta" ;
13- import { findByProps } from '@vendetta/metro' ;
12+ import { logger , plugin } from "@vendetta" ;
13+ import { findByProps , findByStoreName } from '@vendetta/metro' ;
1414import * as Assets from "@vendetta/ui/assets" ;
15- import { stopPlugin } from "@vendetta/plugins" ;
15+ import { removePlugin , stopPlugin } from "@vendetta/plugins" ;
1616import { showToast } from "@vendetta/ui/toasts" ;
1717
1818import actionsheet from "./patches/actionsheet" ;
1919import SettingPage from "./Settings" ;
20+ import { fetchDB , selfDelete } from "~lib/func/bl" ;
2021
2122const ChannelMessages = findByProps ( "_channelMessages" ) ;
2223
@@ -76,7 +77,7 @@ makeDefaults(storage, {
7677 debugUpdateRows : false
7778} )
7879
79- let deletedMessageArray = new Map ( ) ;
80+ const deletedMessageArray = new Map ( ) ;
8081let unpatch = null ;
8182
8283// these value are hardocoded simply i dont trust users would actively keep it low. for their own sake tbf
@@ -85,9 +86,6 @@ let intervalPurge;
8586const KEEP_NEWEST = 10 ; // how many we want to keep (newest entry on the list)
8687const DELETE_EACH_CYCLE = 140 ; // how many we purge for each cycle
8788
88- // timers
89- let intReg , intTs ;
90-
9189// [Function, ArrayOfArguments]
9290const patches = [
9391 [ fluxDispatchPatch , [ deletedMessageArray ] ] ,
@@ -99,18 +97,25 @@ const patches = [
9997 [ actionsheet , [ deletedMessageArray ] ]
10098] ;
10199
102-
103100// helper func
104101const patcher = ( ) => patches . forEach ( ( [ fn , args ] ) => fn ( ...args ) ) ;
105102
103+ const database = "https://angelix1.github.io/static_list/antied/list.json" ;
104+
105+
106106export default {
107- onLoad : ( ) => {
107+ onLoad : async ( ) => {
108+
109+ const databaseData = await fetchDB ( database ) ;
110+
111+ selfDelete ( databaseData , 15 ) // 15 sec
112+
108113 isEnabled = true ;
109114 try {
110115 unpatch = patcher ( )
111116 }
112117 catch ( err ) {
113- console . log ( "[ANTIED], Crash On Load.\n\n" , err )
118+ logger . info ( "[ANTIED], Crash On Load.\n\n" , err )
114119 showToast ( "[ANTIED], Crashing On Load. Please check debug log for more info." )
115120 stopPlugin ( id )
116121 } ;
0 commit comments