import { Filters , filterInterface , filterOutput } from "../filters" ; import { Message , Guild } from "discord.js" ; import { filterActions , filterAction } from "../utils/filters" ; import { Bot } from ".." ; let filter = { name : undefined , path : undefined , shortHelp : undefined , embedHelp : undefined , run : undefined } ; filter . name = "kappa" ; filter . path = '' ; filter . shortHelp = "replies with kappa and deletes it messages with kappa" ; filter . embedHelp = async ( guild ) => { return { "embed" : { "color" : Bot . database . settingsDB . cache . embedColors . help , "author" : { "name" : "Filter: " + filter . name } , "fields" : [ { "name" : "Description:" , "value" : "This filter will just reply kappa to everything and delete any message which contains kappa" } ] } } ; } ; filter . run = ( message ) : Promise < filterOutput > => { let actions = new Array ( ) ; let unconditionalAction = { type : filterActions . send , message : "kappa" } ; actions [ 0 ] = unconditionalAction ; let conditionalAction = { type : filterActions . delete , delay : 1000 , } ; if ( message . content . includes ( "kappa" ) ) { actions . push ( conditionalAction ) ; } let output = { reason : "as you wish master" , actions : actions } ; return Promise . resolve ( output ) ; } ; export default filter ;