File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import discord from "discord.js";
1111import fs from "fs" ;
1212import { BannedPlayers , ExtraBans } from "./sqlitedb" ;
1313import { FactorioServer } from "../types" ;
14+ import UserModel from "../base/User" ;
15+ import { mongoose } from "@typegoose/typegoose" ;
1416
1517export type ArgumentTypes < F extends Function > = F extends ( args : infer A ) => any
1618 ? A
@@ -208,6 +210,17 @@ export async function addban(playername: string, reason: string) {
208210 reason : reason || "No reason given" ,
209211 } ) ;
210212
213+ UserModel . deleteMany ( { factorioName : playername } ) . exec ( )
214+ mongoose . connections [ 1 ]
215+ . getClient ( )
216+ . db ( "scenario" )
217+ . collections ( )
218+ . then ( ( collections ) => {
219+ collections . map ( ( collection ) => {
220+ collection . deleteMany ( { playername : playername } )
221+ } )
222+ } )
223+
211224 return player ;
212225}
213226
You can’t perform that action at this time.
0 commit comments