//#region extensions/telegram/src/adapters/debounce-keys.ts
function telegramDebouncerKeyPolicy() {
	return {
		buildKey: (item) => {
			const chatId = item.ctx.chat?.id?.toString();
			const userId = item.ctx.from?.id?.toString();
			if (!chatId || !userId) return void 0;
			return `telegram:${item.accountId}:${chatId}:${userId}`;
		},
		shouldDebounce: (item) => {
			const text = item.message.text ?? item.message.caption ?? "";
			if (text.startsWith("/")) return false;
			if (item.message.photo || item.message.document || item.message.video) return false;
			return text.length < 100;
		}
	};
}
//#endregion
export { telegramDebouncerKeyPolicy };

//# sourceMappingURL=debounce-keys.js.map