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

nuno

Joined 4 months ago

Recently created
Least recently created
Recently updated
Least recently updated
All gists 582

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 /opt/docker/tg-bot-ts-dev/src/handlers/buttons.ts:247: const starEmoji = process.env.ACTIVE_CHAR_EMOJI || "⭐";
2 /opt/docker/tg-bot-ts-dev/src/handlers/buttons.ts:29:const LOCK_AT = parseInt(process.env.LOCK_AT ?? "10");
3 /opt/docker/tg-bot-ts-dev/src/subcommands/poll/start.ts:24: console.log("POLL_CHANNEL_ID env:", process.env.POLL_CHANNEL_ID);
4 /opt/docker/tg-bot-ts-dev/src/systems/benchmark.ts:57: const _enabled = () => process.env.LOG_LEVEL?.toUpperCase() === "DEBUG";
5 /opt/docker/tg-bot-ts-dev/src/systems/config.ts:16: pollChannelId: process.env.POLL_CHANNEL_ID ?? "",
6 /opt/docker/tg-bot-ts-dev/src/systems/config.ts:17: resultsChannelId: process.env.RESULTS_CHANNEL_ID ?? "",
7 /opt/docker/tg-bot-ts-dev/src/systems/config.ts:18: scoreChannelId: process.env.SCORE_CHANNEL_ID ?? "",
8 /opt/docker/tg-bot-ts-dev/src/systems/conflict.ts:24:const AUTO_VOTE_ON_SWITCH = process.env.AUTO_VOTE_ON_CONFLICT_SWITCH !== "false";
9 /opt/docker/tg-bot-ts-dev/src/systems/conflict.ts:25:const RECLAIM_NOTIFY_BORROWER = process.env.RECLAIM_NOTIFY_BORROWER !== "false";
10 /opt/docker/tg-bot-ts-dev/src/systems/impersonate.ts:4:const IMPERSONATE_RESET_ON_POLL = process.env.IMPERSONATE_RESET_ON_POLL !== "false";

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 import path from "path";
2 import { BotConfig, Nation } from "../types";
3 import { Store } from "@systems/store";
4 import { Paths } from "@helpers/paths";
5
6
7 // Function instead of const so env vars are read lazily at call time
8 function getDefaults(): Required<BotConfig> {
9 return {
10 officerRoles: ["Ice King"],

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 2 months 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 ───────────────────────────────────────────────────
Newer Older

Powered by Opengist ⋅ Load: 94ms⋅

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