ForgeScript
ForgeScript is a comprehensive package that empowers you to effortlessly interact with Discord's API. It ensures scripting remains easy to learn and consistently effective.
ForgeScript
ForgeScript is a comprehensive package that empowers you to effortlessly interact with Discord's API. It ensures scripting remains easy to learn and consistently effective.
${p.replace(/`([^`]+)`/g, ' Note: Actual available properties depend on the specific event and its data structure.`; if(contentArea) contentArea.innerHTML = ` ${event.description}${event.intents && event.intents.length > 0 ? ` This event does not require specific intents (or intents are not specified).'}${contextHtml}$1')}`).join('');
applyArgumentTypeTooltips(functionSummaryText);
applyGeneralCrossLinking(functionSummaryText);
summaryGenerated = true;
}
if (functionDocWrapper) functionDocWrapper.style.display = 'none';
functionSummaryContainer.style.display = 'block';
summaryBtnText.textContent = 'Back to Full Details';
summaryBtnIcon.setAttribute('icon', 'basil:arrow-left-outline');
functionSummaryContainer.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
setTimeout(updateOnPageNav, 0);
});
const paginationContainer = document.getElementById('pagination-container');
appendPrevNextNavigation(func, 'function', paginationContainer);
const usageCodeElement = document.getElementById('function-usage-code');
const copyBtn = document.getElementById('copy-usage-btn');
if (copyBtn && usageCodeElement && typeof tippy !== 'undefined') {
const iconElement = copyBtn.querySelector('iconify-icon');
const originalIcon = iconElement.getAttribute('icon');
tippy(copyBtn, { content: 'Copy function usage', theme: 'translucent-tooltip', placement: 'top', arrow: false, animation: 'fade', duration: [200,200] });
copyBtn.addEventListener('click', () => {
navigator.clipboard.writeText(usageCodeElement.textContent.trim()).then(() => {
iconElement.icon = 'fluent:checkmark-12-filled';
iconElement.classList.add('text-xl');
copyBtn.classList.add('bg-green-500', 'pointer-events-none');
copyBtn.classList.remove('bg-black/60', 'hover:bg-black/80');
setTimeout(() => {
iconElement.icon = originalIcon;
iconElement.classList.remove('text-xl');
copyBtn.classList.remove('bg-green-500', 'pointer-events-none');
copyBtn.classList.add('bg-black/60', 'hover:bg-black/80');
}, 1500);
}).catch(err => {});
});
}
if (func.brackets === false) {
const toggleBtn = document.getElementById('toggle-brackets-btn');
if (toggleBtn && usageCodeElement && typeof tippy !== 'undefined') {
tippy(toggleBtn, { content: 'Toggle bracket usage', theme: 'translucent-tooltip', placement: 'top', arrow: false, animation: 'fade', duration: [200,200] });
let currentlyShowingBrackets = initialDisplayWithBrackets;
toggleBtn.addEventListener('click', () => {
currentlyShowingBrackets = !currentlyShowingBrackets;
usageCodeElement.innerHTML = generateUsageStringForCodeBlock(func, currentlyShowingBrackets);
if (currentlyShowingBrackets && func.args && func.args.length > 0)
attachArgSpanHoverListeners(func, usageCodeElement, tooltipElement, arrowSvgElement);
});
}
}
contentArea.querySelectorAll('.referenced-guide-item').forEach(item => {
item.addEventListener('click', (e) => {
const guideId = parseInt(item.dataset.guideId, 10);
const guideData = DEDICATED_GUIDES.find(g => g.id === guideId);
if (guideData) {
document.querySelectorAll('[data-tippy-root]').forEach(root => {
if (root._tippy) root._tippy.hide();
});
displayDedicatedGuide(guideData);
}
});
});
if (initialDisplayWithBrackets && func.args && func.args.length > 0 && usageCodeElement)
attachArgSpanHoverListeners(func, usageCodeElement, tooltipElement, arrowSvgElement);
if (typeof tippy !== 'undefined' && contentArea) {
const genericTooltipsInContent = contentArea.querySelectorAll('[data-tippy-dynamic-content]');
if (genericTooltipsInContent.length > 0)
initializeDynamicTooltips(contentArea);
}
if(contentArea) {
applyArgumentTypeTooltips(contentArea);
applyGeneralCrossLinking(contentArea);
}
updateOnPageNav();
fetchAndDisplaySpecificGuide('function', func.name, 'ForgeScript');
}
function displayEventDetails(event) { if (typeof switchToTab === 'function') switchToTab('documentation');clearGuideMetadataSidebar(); updateUrl('event', event.name); let typicalDataContext = { "messageCreate": ["message", "author", "channel", "guild", "member", "client"], "guildMemberAdd": ["member", "guild", "client"], "interactionCreate": ["interaction", "client"] }; let contextHtml = ''; if(typicalDataContext[event.name]) contextHtml = `${event.name}${event.version ? `v${event.version}` : ''}