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 / interpolate

0 likes
0 forks
1 files
Last active 2 months 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 2 months 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; }'.

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 { CharacterMap, Character, ClassKey, Nation, AccountMap, AccountData } from "../types";
4
5 const CHARS_PATH = path.join(__dirname, "../../data/characters.json");
6 const ACCOUNTS_PATH = path.join(__dirname, "../../data/accounts.json");
7
8 let _chars: CharacterMap = {};
9 let _accounts: AccountMap = {};

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
4 const IMPERSONATE_RESET_ON_POLL = process.env.IMPERSONATE_RESET_ON_POLL !== "false";
5 const IMPERSONATE_INDICATOR = process.env.IMPERSONATE_INDICATOR !== "false";
6
7 // realDiscordId → userKey being impersonated
8 const impersonations = new Map<string, string>();
9
10 export function setImpersonation(realDiscordId: string, userKey: string): void {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 import {
2 ChatInputCommandInteraction,
3 ButtonInteraction,
4 ButtonBuilder,
5 ButtonStyle,
6 ActionRowBuilder,
7 EmbedBuilder,
8 } from "discord.js";
9 import { cfg } from "@systems/config";
10 import { hasOfficerRole } from "@systems/users";

nuno / interactions.ts

0 likes
0 forks
1 files
Last active 2 months ago
1 import { Interaction, ChatInputCommandInteraction, ButtonInteraction, TextChannel, StringSelectMenuInteraction } from "discord.js";
2 import { handleButton, handleScoreSubmitButton } from "@handlers/buttons";
3 import { handleTgCommand } from "@commands/tg";
4 import { handleTgConfigCommand } from "@commands/tgConfig";
5 import { handleBorrowAcceptButton } from "@subcommands/char/accept";
6 import { handleBorrowDeclineButton } from "@subcommands/char/decline";
7 import { handleConflictButton } from "@systems/conflict";
8 import { handleImpersonateButton } from "@subcommands/impersonate";
9 import { handleAutocomplete } from "@handlers/autocomplete";
10 import { setActiveCharacter, getCharacterByName, getCharacters } from "@systems/characters";

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
4 const IMPERSONATE_RESET_ON_POLL = process.env.IMPERSONATE_RESET_ON_POLL !== "false";
5 const IMPERSONATE_INDICATOR = process.env.IMPERSONATE_INDICATOR !== "false";
6
7 // realDiscordId → userKey being impersonated
8 const impersonations = new Map<string, string>();
9
10 export function setImpersonation(realDiscordId: string, userKey: string): void {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 import {
2 ChatInputCommandInteraction,
3 ButtonInteraction,
4 ButtonBuilder,
5 ButtonStyle,
6 ActionRowBuilder,
7 EmbedBuilder,
8 } from "discord.js";
9 import { cfg } from "@systems/config";
10 import { hasOfficerRole } from "@systems/users";

nuno / scheduler.ts

0 likes
0 forks
1 files
Last active 2 months ago
1 import cron from "node-cron";
2 import { TextChannel } from "discord.js";
3
4 // Lock poll at TG start (20:00), reveal Submit Score button at TG end (20:35)
5 // Runs daily — no-ops silently if no poll is active for that slot.
6
7 cron.schedule("0 20 * * *", async () => {
8 const slot = 20;
9 const state = polls.get(slot);
10 if (!state || state.locked) return;

nuno / slots.ts

0 likes
0 forks
1 files
Last active 2 months ago
1 import cron from "node-cron";
2 import { Client, TextChannel } from "discord.js";
3 import { cfg } from "./config";
4 import { TGSlot } from "../types";
5 import { polls, updatePollMessage } from "@systems/poll";
6
7 type PollCallback = (slot: TGSlot) => Promise<void>;
8 type CloseCallback = (slot: TGSlot) => Promise<void>;
9 type LockCallback = (slot: TGSlot) => Promise<void>;
Newer Older

Powered by Opengist ⋅ Load: 96ms⋅

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