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 6 months ago

Recently created
Least recently created
Recently updated
Least recently updated
All gists 584

nuno / nations.ts

0 likes
0 forks
1 files
Last active 4 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 4 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 ───────────────────────────────────────────────────

nuno / interpolate

0 likes
0 forks
1 files
Last active 4 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 4 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 4 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 4 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 4 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 4 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 4 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 4 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";
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