Skip to content

Commit

Permalink
Return fun for @everyone; Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Agadar committed Jun 8, 2024
1 parent f70c2b3 commit 4887cfb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chat/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class Chat {
public removeUser(userId: number): User | null {
const userToRemove = this.users.get(userId);
this.users.delete(userId);
return userToRemove ? userToRemove:null;
return userToRemove ? userToRemove : null;
}

/**
Expand Down Expand Up @@ -252,7 +252,7 @@ export class Chat {
this.pluginHost.triggerEvent(PluginEvent.ChatMessage, eventArgs);

// Check if this is an @Everyone message to be broadcasted to all members of the chat
if (/@everyone(\s|$)/i.test(msg.text)) {
if (/@everyone/i.test(msg.text)) {
let allUserPrefix = "";
this.users.forEach((usr) => {
if (usr.broadcastOptin && usr.id !== user.id && usr.name !== "anonymous") {
Expand Down Expand Up @@ -299,7 +299,7 @@ export class Chat {
// Construct string to return.
const oldLeaderboard = this.myLastLeaderboard;
this.myLastLeaderboard = new Leaderboard(Array.from(this.users.values()));
let leaderboard = "<b>🏆 " + (final ? "FINAL ":"") + "LEADERBOARD</b>\n";
let leaderboard = "<b>🏆 " + (final ? "FINAL " : "") + "LEADERBOARD</b>\n";
leaderboard += this.myLastLeaderboard.toString(oldLeaderboard);

// Reset last score change values of all users.
Expand Down Expand Up @@ -497,7 +497,7 @@ export class Chat {
if (this.userDeservesHandicapBonus(user.id)) {
score *= this.handicapsMultiplier;
}
const alterUserScoreReason = dankTime.isRandom ? AlterUserScoreArgs.RANDOM_DANKTIME_REASON:AlterUserScoreArgs.NORMAL_DANKTIME_REASON;
const alterUserScoreReason = dankTime.isRandom ? AlterUserScoreArgs.RANDOM_DANKTIME_REASON : AlterUserScoreArgs.NORMAL_DANKTIME_REASON;
const alterUserScoreArgs = new AlterUserScoreArgs(user, Math.round(score), AlterUserScoreArgs.DANKTIMESBOT_ORIGIN_NAME,
alterUserScoreReason, now.unix());
this.alterUserScore(alterUserScoreArgs);
Expand Down

0 comments on commit 4887cfb

Please sign in to comment.