Все Новый

user:thomas фрагментов создано пользователем

title:mygist фрагментов с указанным заголовком

description:sync gists with given description

filename:myfile.txt фрагменты содержащие файлы с указанным именем

extension:yml фрагменты, содержащие файлы с указанным расширением

language:go фрагменты, содержащие файлы с указанным языком

topic:homelab фрагменты с заданной темой

all:systemctl search all fields

Регистрация

Войти

Все Новый Регистрация Войти

nuno

Зарегистрирован 2 months ago

Свежие сверху по дате создания
Свежие снизу по дате создания
Свежие сверху по дате обновления
Свежие снизу по дате обновления
Все фрагменты 570

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 // Click tracking
2 if (!clickCounts.has(voteId)) clickCounts.set(voteId, { yes: 0, no: 0 });
3 const clicks = clickCounts.get(voteId)!;
4
5 if (votedYes && clicks.yes >= LOCK_AT) return;
6 if (!votedYes && clicks.no >= LOCK_AT) return;
7
8 // Ignore same vote
9 if (votedYes && state.yes.has(voteId)) return;
10 if (!votedYes && state.no.has(voteId)) return;

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 import {
2 Client,
3 ButtonBuilder,
4 ButtonStyle,
5 ActionRowBuilder,
6 EmbedBuilder,
7 ButtonInteraction,
8 TextChannel,
9 } from "discord.js";
10 import { cfg } from "./config";

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 if (baseEntry.characterName) {
2 console.log(`[vote] voteId=${voteId} yes keys:`, [...state.yes.keys()], 'no keys:', [...state.no.keys()]);
3 for (const [otherId, entry] of [...state.yes.entries(), ...state.no.entries()]) {
4 if (otherId !== userId && entry.characterName === baseEntry.characterName) {
5 // Check if this user is the owner of the character
6 const borrowerKey = entry.borrowedFrom ? entry.userKey : null;
7 const ownerKey = entry.borrowedFrom ?? entry.userKey;
8 const isOwner = user.userKey === ownerKey;
9 console.log(`[conflict] user.userKey=${user.userKey} entry.userKey=${entry.userKey} borrowedFrom=${entry.borrowedFrom} ownerKey=${ownerKey} isOwner=${isOwner}`);

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 tg-bot-ts-dev | Interaction error: DiscordAPIError[10062]: Unknown interaction
2 tg-bot-ts-dev | at handleErrors (/app/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:148:10)
3 tg-bot-ts-dev | at processTicksAndRejections (node:internal/process/task_queues:103:5)
4 tg-bot-ts-dev | at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/src/lib/handlers/BurstHandler.ts:144:20)
5 tg-bot-ts-dev | at async _REST.request (/app/node_modules/@discordjs/rest/src/lib/REST.ts:210:20)
6 tg-bot-ts-dev | at async ButtonInteraction.deferUpdate (/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:305:22)
7 tg-bot-ts-dev | at async handleButton (/app/src/handlers/buttons.ts:20:3)
8 tg-bot-ts-dev | at async Client.handleInteraction (/app/src/handlers/interactions.ts:34:14) {
9 tg-bot-ts-dev | requestBody: { files: undefined, json: { type: 6 } },
10 tg-bot-ts-dev | rawError: { message: 'Unknown interaction', code: 10062 },

nuno / buttons.ts

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 import { ButtonInteraction, TextChannel } from "discord.js";
2 import { cfg } from "../systems/config";
3 import { pollReplyAndDelete } from "../utils";
4 import { resolveUser } from "../systems/users";
5 import { resolveMessage, nowFormatted } from "../systems/messages";
6 import { resolveNation } from "../systems/nations";
7 import { polls, updatePollMessage, createVoteEntry, getPublicOverride, getEphemeralOverride } from "../systems/poll";
8 import { showConflictEmbed, handleConflictButton } from "../systems/conflict";
9 import { getCharacters } from "../systems/characters";

nuno / buttons.ts

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 import { ButtonInteraction, TextChannel } from "discord.js";
2 import { cfg } from "../systems/config";
3 import { pollReplyAndDelete } from "../utils";
4 import { resolveUser } from "../systems/users";
5 import { resolveMessage, nowFormatted } from "../systems/messages";
6 import { resolveNation } from "../systems/nations";
7 import { polls, updatePollMessage, createVoteEntry, getPublicOverride, getEphemeralOverride } from "../systems/poll";
8 import { showConflictEmbed, handleConflictButton } from "../systems/conflict";
9 import { getCharacters } from "../systems/characters";

nuno / gistfile1.txt

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 Interaction error: DiscordAPIError[10062]: Unknown interaction
2 at handleErrors (/app/node_modules/@discordjs/rest/src/lib/handlers/Shared.ts:148:10)
3 at processTicksAndRejections (node:internal/process/task_queues:103:5)
4 at async BurstHandler.runRequest (/app/node_modules/@discordjs/rest/src/lib/handlers/BurstHandler.ts:144:20)
5 at async _REST.request (/app/node_modules/@discordjs/rest/src/lib/REST.ts:210:20)
6 at async ButtonInteraction.deferUpdate (/app/node_modules/discord.js/src/structures/interfaces/InteractionResponses.js:305:22)
7 at async handleButton (/app/src/handlers/buttons.ts:19:3)
8 at async Client.handleInteraction (/app/src/handlers/interactions.ts:34:14) {
9 requestBody: { files: undefined, json: { type: 6 } },
10 rawError: { message: 'Unknown interaction', code: 10062 },

nuno / scores.ts

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 import { TGScore, Nation, ClassKey } from "../types";
2 import { cfg } from "./config";
3 import { upsertScore, todayString } from "./history";
4 import { recordScore } from "./wrank";
5
6 // Normalize a slot string to a 24h integer hour
7 // Accepts: "20", "8", "8pm", "20:00", "midnight", "midday", "noon"
8 export function normalizeSlot(input: string): number | null {
9 const s = input.trim().toLowerCase();
10 if (s === "midnight") return 0;

nuno / scores.ts

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 export interface ScoreSubmission {
2 usermapKey: string; // owner's key (score goes here)
3 playedBy?: string; // borrower's key if different from owner
4 characterName: string;
5 cls: ClassKey;
6 nation: Nation;
7 pts: number;
8 k?: number;
9 d?: number;
10 slot: number;

nuno / poll.ts

0 лайк(-ов)
0 форк(-ов)
1 файл(-ов)
Последняя активность 1 month ago
1 import {
2 EmbedBuilder,
3 ButtonBuilder,
4 ButtonStyle,
5 ActionRowBuilder,
6 TextChannel,
7 GuildMember,
8 } from "discord.js";
9 import { PollState, VoteEntry, Nation, TGSlot } from "../types";
10 import { cfg } from "./config";
Новее Позже

Работает на Opengist ⋅ Load: 104ms⋅

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