import { Message } from "discord.js" ; import { EventHandler } from "../base/EventHandler" ; import { TundraBot } from "../base/TundraBot" ; import { DBMessage } from "../models/Message" ; import Deps from "../utils/deps" ; export default class MessageDeleteHandler extends EventHandler { protected DBMessageManager : DBMessage ; constructor ( client ) { super ( client ) ; this . DBMessageManager = Deps . get < DBMessage > ( DBMessage ) ; } async invoke ( message ) { if ( message . author . bot ) return ; if ( ! message . guild ) return ; this . DBMessageManager . update ( message , null , { deleted : true } ) ; } }