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 tg-bot-ts-dev | [PollUI] Failed to load layout default.ts: src/ui/poll/layouts/default.ts(7,41): error TS2305: Module '"@types"' has no exported member 'WRankEntry'.
2 tg-bot-ts-dev |
3 tg-bot-ts-dev | [PollUI] Failed to load layout side-by-side.ts: src/ui/poll/layouts/side-by-side.ts(7,41): error TS2305: Module '"@types"' has no exported member 'WRankEntry'.
4 tg-bot-ts-dev |
5 tg-bot-ts-dev | /app/node_modules/ts-node/src/index.ts:859
6 tg-bot-ts-dev | return new TSError(diagnosticText, diagnosticCodes, diagnostics);
7 tg-bot-ts-dev | ^
8 tg-bot-ts-dev | TSError: ⨯ Unable to compile TypeScript:
9 tg-bot-ts-dev | src/subcommands/rank/post.ts(34,42): error TS2345: Argument of type 'SerializableWRankEntry' is not assignable to parameter of type 'WRankEntry'.
10 tg-bot-ts-dev | Property 'character' is missing in type 'SerializableWRankEntry' but required in type 'WRankEntry'.

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 import { Character, ClassKey, CharacterClass, Nation, WRankEntry } from "@src/types";
2 import { Emoji } from "@systems/emojis";
3
4 // ─── Individual formatters ────────────────────────────────────────────────────
5
6 export interface CharDisplayOptions {
7 emoji?: boolean; // show class emoji (default: true)
8 level?: boolean; // show level (default: true)
9 }

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 import fs from "fs";
2 import path from "path";
3 import { HistoryKey, UserKey, CharName, Nation, ClassKey } from "@types";
4 import { Config } from "@systems/config";
5 import { Bringer } from "@systems/bringer";
6 import { Nations } from "@systems/nations";
7 import { Store } from "@systems/store";
8 import { Paths } from "@paths";
9 import { Runtime } from "@systems/runtime";

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 /**
2 * Scheduler — plugin-based cron job manager.
3 *
4 * Drop a file exporting `job: ScheduledJob` in this directory
5 * and it will be automatically scheduled.
6 *
7 * Slot-specific jobs (poll open/lock/close) are registered separately
8 * via Scheduler.scheduleSlots() since they depend on runtime config.
9 */

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 import { ChatInputCommandInteraction } from "discord.js";
2 import { Config } from "@systems/config";
3 import { resolveUser, hasOfficerRole } from "@systems/users";
4 import { submitScore, detectSlot, normalizeSlot } from "@systems/scores";
5 import { getEffectiveCharacter } from "@systems/borrow";
6 import { replyAndDelete } from "@utils";
7 import { getEmoji } from "@systems/emojis";
8
9 export async function handleScoreSet(interaction: ChatInputCommandInteraction): Promise<void> {
10 const member = await interaction.guild!.members.fetch(interaction.user.id);

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 submit({ character, borrowedFrom, pts, k, d, atk, def, heal, slot, submittedByOfficer }: {
2 character: Character;
3 borrowedFrom?: UserKey;
4 pts: number;
5 k?: number;
6 d?: number;
7 atk?: number;
8 def?: number;
9 heal?: number;
10 slot: SlotHour;

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks ago
1 // ── slot ───────────────────────────────────────────────────────────────────
2 if (group === "slot") {
3 if (sub === "add") {
4 const hour = interaction.options.getInteger("hour", true);
5 const pollOpens = interaction.options.getString("poll_opens", true);
6 const slots = Config.get({ section: "poll", key: "slots" });
7 if (slots.some((s) => s.tgHour === hour)) return void replyAndDelete(interaction, `❌ Slot ${hour}:00 already exists.`);
8 slots.push({ tgHour: hour, pollOpens, closesAfter: Config.get({ section: "tg", key: "durationMinutes" }), active: true });
9 Config.set({ section: "poll", key: "slots", value: slots });
10 return void replyAndDelete(interaction, `✅ Slot ${hour}:00 added (poll opens at ${pollOpens}).`);

nuno / set-layout.ts

0 likes
0 forks
1 files
Last active 3 weeks ago
1 import { ChatInputCommandInteraction } from "discord.js";
2 import { cfg, saveConfig } from "@systems/config";
3 import { PollUI } from "@ui/poll";
4 import { replyAndDelete } from "@utils";
5 import { hasOfficerRole } from "@systems/users";
6
7 export async function handleSetLayout(interaction: ChatInputCommandInteraction): Promise<void> {
8 const member = await interaction.guild!.members.fetch(interaction.user.id);
9 if (!hasOfficerRole(member, cfg("officerRoles"))) {
10 return void replyAndDelete(interaction, "❌ Only officers can change the poll layout.", true);

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 3 weeks 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 3 weeks 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"],
Newer Older

Powered by Opengist ⋅ Load: 126ms⋅

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