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 async update({ weekKey }: { weekKey?: string } = {}): Promise<void> {
2 const client = DiscordClient.get();
3 const channelId = Config.get({ section: "channels", key: "leaderboard" });
4 if (!channelId) { log.warn("leaderboard channel not configured"); return; }
5
6 const week = weekKey ? WRank.weekFromKey(weekKey) : WRank.currentWeek();
7 const embed = buildLeaderboardEmbed();
8
9 if (!week) { log.warn(`Week ${weekKey} not found`); return; }
10

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 function buildRows(historyKey: TGKey): ResultRow[] {
2 const { slot } = TGKey.parse(historyKey);
3 let players: UserKey[] = Attendance.players(historyKey);
4 const rows: ResultRow[] = [];
5
6 // Fallback — read from history file directly
7 if (players.length === 0) {
8 const history = Store.read<{ scores: TGScore[] }>(TGKey.toHistoryPath(historyKey));
9 if (history?.scores) {
10 players = [...new Set(history.scores.map((s: TGScore) => s.userKey))];

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 resetWeek(): void {
2 const now = new Date();
3 const newWeekKey = WRank.weekKey(now);
4 const prevWeekKey = WRank.weekKey(new Date(now.getTime() - 7 * 24 * 60 * 60 * 1000));
5
6 // Access internal data via WRank
7 const prevWeek = WRank.weekFromKey(prevWeekKey);
8 const newWeek = WRank.currentWeek(); // ensures new week exists
9
10 if (prevWeek) {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 tg-bot-ts-dev | [CharacterRegistry] cache miss — loading from disk
2 tg-bot-ts-dev | Interaction error: TypeError: Cannot read properties of undefined (reading 'toLowerCase')
3 tg-bot-ts-dev | at Object.class (/app/src/systems/emojis.ts:71:26)
4 tg-bot-ts-dev | at formatLeaderboardRow (/app/src/systems/leaderboard.ts:49:33)
5 tg-bot-ts-dev | at /app/src/systems/leaderboard.ts:73:29
6 tg-bot-ts-dev | at Array.map (<anonymous>)
7 tg-bot-ts-dev | at buildNationField (/app/src/systems/leaderboard.ts:73:18)
8 tg-bot-ts-dev | at buildLeaderboardEmbed (/app/src/systems/leaderboard.ts:148:18)
9 tg-bot-ts-dev | at Object.update (/app/src/systems/leaderboard.ts:177:20)
10 tg-bot-ts-dev | at Object.handleLeaderboardPost [as leaderboardPost] (/app/src/subcommands/admin/result-post.ts:26:21)

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 cmd.addSubcommand((s) => s
2 .setName("score-inject")
3 .setDescription("Inject a score for any player (officer only)")
4 .addStringOption((o) => o.setName("char_name").setDescription("Character").setRequired(true).setAutocomplete(true))
5 .addIntegerOption((o) => o.setName("pts").setDescription("Points").setRequired(true))
6 .addIntegerOption((o) => o.setName("slot").setDescription("TG slot hour").setRequired(true))
7 .addStringOption((o) => o.setName("date").setDescription("Date YYYY-MM-DD (defaults today)"))
8 .addIntegerOption((o) => o.setName("k").setDescription("Kills"))
9 .addIntegerOption((o) => o.setName("d").setDescription("Deaths"))
10 )

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 tg-bot-ts-dev | Interaction error: DiscordjsTypeError [CommandInteractionOptionNoSubcommandGroup]: No subcommand group specified for interaction.
2 tg-bot-ts-dev | at CommandInteractionOptionResolver.getSubcommandGroup (/app/node_modules/discord.js/src/structures/CommandInteractionOptionResolver.js:125:13)
3 tg-bot-ts-dev | at handleTgAdminCommand (/app/src/commands/tgAdmin.ts:140:37)
4 tg-bot-ts-dev | at handleChatInputCommandInteraction (/app/src/handlers/interactions.ts:124:66)
5 tg-bot-ts-dev | at Client.handleInteraction (/app/src/handlers/interactions.ts:106:13)
6 tg-bot-ts-dev | at Client.emit (node:events:519:28)
7 tg-bot-ts-dev | at Client.emit (node:domain:489:12)
8 tg-bot-ts-dev | at InteractionCreateAction.handle (/app/node_modules/discord.js/src/client/actions/InteractionCreate.js:103:12)
9 tg-bot-ts-dev | at Object.module.exports [as INTERACTION_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)
10 tg-bot-ts-dev | at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:352:31)

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:26: const historyKey = TGKey.current({ slot });
2 /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:31: historyKey,
3 /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:58: const historyKey = TGKey.current({ slot });
4 /opt/docker/tg-bot-ts-dev/src/subcommands/poll/mark-left.ts:59: Leaves.unmark({ characterName: char.name, historyKey });
5 /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:19: [historyKey: TGKey]: UserKey[];
6 /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:38: const historyKey = TGKey.current({ slot });
7 /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:39: _data[historyKey] = [...lockedYesKeys];
8 /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:46: players(historyKey: TGKey): UserKey[] {
9 /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:47: return _data[historyKey] ?? [];
10 /opt/docker/tg-bot-ts-dev/src/systems/attendance.ts:53: includes(historyKey: TGKey, userKey: UserKey): boolean {

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 import { ChatInputCommandInteraction } from "discord.js";
2 import { Updates } from "@systems/updates";
3 import { Discord } from "@discord";
4
5 export async function handleUpdatesPost(interaction: ChatInputCommandInteraction): Promise<void> {
6 await Discord.Interaction.deferReply(interaction, { ephemeral: true });
7
8 const opts = Discord.Interaction.options(interaction);
9 const version = opts.string({ key: "version" }) ?? Updates.latest();
10

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 tg-bot-ts | Interaction error: DiscordAPIError[10062]: Unknown interaction
2 tg-bot-ts | at handleErrors (/app/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:148:10)
3 tg-bot-ts | at processTicksAndRejections (node:internal/process/task_queues:103:5)
4 tg-bot-ts | at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/src/lib/handlers/BurstHandler.ts:144:20)
5 tg-bot-ts | at async _REST.request (/app/node_modules/@discordjs/rest/src/lib/REST.ts:210:20)
6 tg-bot-ts | at async AutocompleteInteraction.respond (/app/node_modules/discord.js/src/structures/AutocompleteInteraction.js:86:5)
7 tg-bot-ts | at async Object.autocompleteVersion [as autocomplete] (/app/src/subcommands/admin/updates.ts:58:3)
8 tg-bot-ts | at async Client.handleInteraction (/app/src/handlers/interactions.ts:83:7) {
9 tg-bot-ts | requestBody: { files: undefined, json: { type: 8, data: [Object] } },
10 tg-bot-ts | rawError: { message: 'Unknown interaction', code: 10062 },

nuno / gistfile1.txt

0 likes
0 forks
1 files
Last active 2 months ago
1 tg-bot-ts-dev | Interaction error: CombinedError (2)
2 tg-bot-ts-dev | Received one or more errors
3 tg-bot-ts-dev |
4 tg-bot-ts-dev | 1 ExpectedValidationError > s.literal(V)
5 tg-bot-ts-dev | | Expected values to be equals
6 tg-bot-ts-dev | |
7 tg-bot-ts-dev | | Expected:
8 tg-bot-ts-dev | | | null
9 tg-bot-ts-dev | |
10 tg-bot-ts-dev | | Received:
Newer Older

Powered by Opengist ⋅ Load: 97ms⋅

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