import { UserState } from "../../message/twitch-types/userstate" ; import { UserStateTracker } from "../userstate-tracker" ; interface FastSpamResult { fastSpam : boolean ; certain : boolean ; } export function canSpamFast ( channelName , loggedInUsername , userStateTracker ? ) ; export function canSpamFast ( channelName , loggedInUsername , userState ) ; export function canSpamFast ( channelName , loggedInUsername , userStateInput ) { if ( channelName === loggedInUsername ) { return { fastSpam : true , certain : true } ; } let userState ; if ( userStateInput instanceof UserStateTracker ) { userState = userStateInput . getChannelState ( channelName ) ; } else { userState = userStateInput ; } if ( userState == null ) { return { fastSpam : false , certain : false } ; } return { fastSpam : userState . isMod || userState . badges . hasVIP || userState . badges . hasModerator || userState . badges . hasBroadcaster , certain : true , } ; }