Skip to content

Commit

Permalink
feat: SuccessHandler now handles general messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
KararTY committed Aug 12, 2020
1 parent 6ef5143 commit 71d2309
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/Handlers/SuccessHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,26 @@ export default class SuccessHandler extends DefaultHandler {
// public async onCommand (msg: PrivmsgMessage) {}

public async onServerResponse ({ channelTwitch, userTwitch, result }: BASE) {
// Send to this user.
this.twitch./* TODO: whisper */sendMessage(
/** TODO. REMOVE */channelTwitch.name,
userTwitch.name,
String(result.value).replace('%s%', `@${String(result.matchUsername)}`),
)
// This is a match "success".
if (result.matchUsername !== undefined) {
// Send to this user.
this.twitch./* TODO: whisper */sendMessage(
/** TODO. REMOVE */channelTwitch.name,
userTwitch.name,
String(result.value).replace('%s%', `@${String(result.matchUsername)}`),
)

// // Send to matched user.
// this.twitch./* TODO: whisper */sendMessage(
// /** TODO. REMOVE */channelTwitch.name,
// result.matchUsername,
// String(result.value).replace('%s%', `@${String(userTwitch.name)}`),
// )
// // Send to matched user.
// this.twitch./* TODO: whisper */sendMessage(
// /** TODO. REMOVE */channelTwitch.name,
// result.matchUsername,
// String(result.value).replace('%s%', `@${String(userTwitch.name)}`),
// )

this.twitch.removeUserInstance({ channelTwitch, userTwitch })
this.twitch.removeUserInstance({ channelTwitch, userTwitch })
} else {
// This is a general acknowledgement message from the server.
this.twitch.sendMessage(channelTwitch.name, userTwitch.name, String(result.value))
}
}
}

0 comments on commit 71d2309

Please sign in to comment.