Skip to content

Commit

Permalink
fix: display_name should be username
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicToast committed Sep 23, 2024
1 parent 8498cb5 commit 0b98b9a
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions apps/twitch-viewer-service/src/app/viewer/viewer.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export class ViewerController {
}

@MessagePattern(TwitchViewerTopics.JOIN)
async updateViewerJoin(@Payload('display_name') display_name: string) {
async updateViewerJoin(@Payload('username') username: string) {
try {
const viewer = await this.getViewerByDisplayName(display_name);
const viewer = await this.getViewerByDisplayName(username);
if (!viewer) {
return await this.createViewerByDisplayName(display_name);
return await this.createViewerByDisplayName(username);
}
const newJoins = viewer.joins + 1;
return await this.service.updateViewer(viewer.id, newJoins);
Expand All @@ -45,11 +45,11 @@ export class ViewerController {
}

@MessagePattern(TwitchViewerTopics.PART)
async updateViewerPart(@Payload('display_name') display_name: string) {
async updateViewerPart(@Payload('username') username: string) {
try {
const viewer = await this.getViewerByDisplayName(display_name);
const viewer = await this.getViewerByDisplayName(username);
if (!viewer) {
return await this.createViewerByDisplayName(display_name);
return await this.createViewerByDisplayName(username);
}
const newParts = viewer.parts + 1;
return await this.service.updateViewer(
Expand All @@ -63,11 +63,11 @@ export class ViewerController {
}

@MessagePattern(TwitchViewerTopics.TIMEOUT)
async updateViewerTimeout(@Payload('display_name') display_name: string) {
async updateViewerTimeout(@Payload('username') username: string) {
try {
const viewer = await this.getViewerByDisplayName(display_name);
const viewer = await this.getViewerByDisplayName(username);
if (!viewer) {
return await this.createViewerByDisplayName(display_name);
return await this.createViewerByDisplayName(username);
}
const newTimeouts = viewer.timeouts + 1;
return await this.service.updateViewer(
Expand All @@ -83,11 +83,11 @@ export class ViewerController {
}

@MessagePattern(TwitchViewerTopics.BAN)
async updateViewerBan(@Payload('display_name') display_name: string) {
async updateViewerBan(@Payload('username') username: string) {
try {
const viewer = await this.getViewerByDisplayName(display_name);
const viewer = await this.getViewerByDisplayName(username);
if (!viewer) {
return await this.createViewerByDisplayName(display_name);
return await this.createViewerByDisplayName(username);
}
const newBans = viewer.bans + 1;
return await this.service.updateViewer(
Expand Down

0 comments on commit 0b98b9a

Please sign in to comment.