import { Reaction , ReactionHandleOptions , ReactionCanHandleOptions } from './reaction' ; import { IssuePayload } from '../../schemas/github/issue-payload' ; export class IssueAssigned extends Reaction { getStreamLabsMessage ( { payload } ) { return `*${ payload . assignee ?. login }* has a new assigned issue in *${ payload . repository . full_name }*` ; } getTwitchChatMessage ( { payload } ) { return `${ payload . assignee ?. login } has a new assigned issue in ${ payload . issue . html_url }` ; } canHandle ( { payload , event , config } ) { return ( event === 'issues' && payload . action === 'assigned' && ! ! payload . assignee && ( ! config || config . NOTIFY_ISSUES_ASSIGNED_TO . length === 0 || config . NOTIFY_ISSUES_ASSIGNED_TO . includes ( payload . assignee . login ) ) ) ; } }