All New

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Register

Login

All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 function formatCharRow(entry: VoteEntry, showNationEmoji = false, nationHasRank = false): string {
2 const cfgFormat = cfg("charDisplayFormat");
3 const nation = entry.characterNation;
4 const wRankEntry = entry.characterName && entry.characterNation
5 ? WRank.entry(entry.characterName, entry.characterNation)
6 : null;
7
8 let wrank = "";
9 if (wRankEntry) {
10 const wRankGoal = cfg("wRankGoal");

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 diff --git a/src/systems/format.ts b/src/systems/format.ts
2 index 7205b43..fe5b6bb 100644
3 --- a/src/systems/format.ts
4 +++ b/src/systems/format.ts
5 @@ -92,7 +92,7 @@ function wrankDelta(entry: WRankEntry, options?: { brackets?: boolean }): string
6 const numEmoji = getEmoji(`wrank_down_${delta}`);
7 inner = (getEmoji("wrank_down") || "↓") + (numEmoji || delta);
8 } else {
9 - inner = (getEmoji("wrank_neutral") || "·") + "0";
10 + inner = (getEmoji("wrank_no_dash") || "·") + (getEmoji("wrank_neutral_0") || "0");

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 // Prod
2
3 root@docker:/opt/docker/tg-bot-ts# git log --oneline -5
4 88f53df (HEAD -> master, origin/master) add norank to wrank formatting
5 77c0651 merge dev
6 8ffe834 (origin/ux-layouts) update .gitignore
7 29aa853 feat: character sharing/borrowing, impersonation, conflict resolution, W.Rank per char, autocomplete, UI improvements
8 4c60ff2 update before dev merge
9 root@docker:/opt/docker/tg-bot-ts# git branch -vv
10 dev 61bb590 [origin/dev] fix history overwritten for same userKey with different chars

nuno / .gitignore

0 likes
0 forks
1 files
Last active 3 weeks ago
1 # Dependencies
2 node_modules/
3
4 docker-compose.yml
5 package-lock.json
6
7 # Environment variables — never commit these
8 .env
9
10 # Runtime data — server-specific, never commit

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 #!/usr/bin/env bash
2
3 # ============================================
4 # Core
5 # ============================================
6
7 LOG_LEVEL=${LOG_LEVEL:-INFO}
8
9 # ============================================
10 # Internal

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 // autocomplete.ts
2 let _usermapCache: Record<string, any> | null = null;
3
4 function getUsermapCache(): Record<string, any> {
5 if (!_usermapCache) {
6 try { _usermapCache = JSON.parse(fs.readFileSync(Paths.data("usermap.json"), "utf8")); }
7 catch { _usermapCache = {}; }
8 }
9 return _usermapCache!;
10 }

nuno / nations.ts

0 likes
0 forks
1 files
Last active 3 weeks ago
1 import { GuildMember } from "discord.js";
2 import { Nation } from "../types";
3 import { getActiveCharacter } from "./characters";
4
5 export const NATION_UNICODE: Record<string, string> = {
6 Capella: "🔴",
7 Procyon: "🔵",
8 };
9
10 export const NATION_KEY: Record<Nation, "capella" | "procyon"> = {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 import { Client, TextChannel, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
2 import fs from "fs";
3 import path from "path";
4 import { BorrowRequest } from "@src/types";
5 import { cfg } from "@systems/config";
6 import { getCharacterByName } from "@systems/characters";
7
8 const PREFS_PATH = path.join(__dirname, "../../data/sessionPreferences.json");
9
10 // ─── Persistent preferences ───────────────────────────────────────────────────

nuno / interpolate

0 likes
0 forks
1 files
Last active 3 weeks ago
1 export function interpolate(
2 message: string,
3 username: string,
4 serverNickname: string | null,
5 globalNickname: string | null,
6 aliases: string[]
7 ): string {
8 const displayName = serverNickname ?? globalNickname ?? username;
9 const dt = getNow();

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 Type '{ class: CharacterClass; ownerKey: string; name: string; level: number; nation: Nation; active?: boolean | undefined; sharedWith?: string[] | undefined; stats?: { atk?: number | undefined; def?: number | undefined; heal?: number | undefined; } | undefined; }' is not assignable to type 'Character'.
2 Types of property 'active' are incompatible.
3 Type 'boolean | undefined' is not assignable to type 'boolean'.
4 Type 'undefined' is not assignable to type 'boolean'.
5
6 Type '{ class: ClassKey; name: string; level: number; nation: Nation; active: boolean; stats?: CharacterStats | undefined; sharedWith?: string[] | undefined; }' is not assignable to type 'SerializableCharacter'.
7 Types of property 'stats' are incompatible.
8 Type 'CharacterStats | undefined' is not assignable to type '{ atk?: number | undefined; def?: number | undefined; heal?: number | undefined; } | undefined'.
9 Type 'CharacterStats' has no properties in common with type '{ atk?: number | undefined; def?: number | undefined; heal?: number | undefined; }'.
Newer Older

Powered by Opengist ⋅ Load: 120ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ KrilHub