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 / wrank.ts

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

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 function buildEmbed(state: PollState, options?: PollEmbedOptions): EmbedBuilder {
2 const yesByNation: Record<Nation, VoteEntry[]> = {
3 [Nation.Capella]: [],
4 [Nation.Procyon]: [],
5 };
6 const noVoters: VoteEntry[] = [];
7 const allMessages: { entry: VoteEntry; voteType: "yes" | "no" }[] = [];
8 const showNoInline = Config.get({ section: "poll", key: "showNoInNationField" });
9
10 for (const entry of state.yes.values()) {

nuno / gistfile1.txt

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

Powered by Opengist ⋅ Load: 128ms⋅

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