Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaderboard #156

Merged
merged 8 commits into from
Jun 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move getCleanName to utils
iminlikewithyou committed Jun 23, 2024

Verified

This commit was signed with the committer’s verified signature.
JounQin JounQin
commit 8d51111660669ff2b242ec8a93728b111de068fe
14 changes: 1 addition & 13 deletions lame-bot/src/word-bomb-mini.ts
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ import {
} from "../../src/dictionary/dictionary";
import { getRemarkEmoji, getStreakNumbers } from "../../src/emoji-renderer";
import { convertTextToHighlights, escapeRegExp, getPromptRegexDisplayText, getPromptRepeatableText } from "../../src/regex";
import { createEnglishList, escapeDiscordMarkdown, formatNumber, formatPercentage, formatPlacement } from "../../src/utils";
import { createEnglishList, escapeDiscordMarkdown, formatNumber, formatPercentage, formatPlacement, getCleanName } from "../../src/utils";
import { getChannel, getGuild, lameBotClient, sendMessage, sendMessageAsReply } from "./client";

let guild;
@@ -163,18 +163,6 @@ async function startRound() {
await startRound();
})();

function getCleanName(name) {
let cleanName = escapeDiscordMarkdown(name.replace(/﷽𒐫𒈙⸻꧅ဪ௵௸/g, ""));
if (cleanName === "") {
if (name.length === 0) {
return "Lame Member";
} else {
return "\\" + name[0];
}
}
return cleanName;
}

async function getDisplayName(userID) {
return await guild.members
.fetch(userID)