2025-02-22 22:56:09 -06:00
|
|
|
import styles from "./page.module.css";
|
2025-02-22 23:00:37 -06:00
|
|
|
import dynamic from 'next/dynamic';
|
|
|
|
|
|
|
|
|
|
const CodeExample = dynamic(
|
2025-02-22 23:50:08 -06:00
|
|
|
() => import('../components/CodeExample')
|
2025-02-22 23:00:37 -06:00
|
|
|
);
|
2025-02-22 22:56:09 -06:00
|
|
|
|
2025-02-23 00:27:31 -06:00
|
|
|
import { simpleExample, hydrationExample, typeCoercionExample } from '../components/CodeExample';
|
2025-02-22 23:32:23 -06:00
|
|
|
|
2025-02-22 22:56:09 -06:00
|
|
|
export default function Home() {
|
|
|
|
|
return (
|
|
|
|
|
<div className={[styles.page, styles.pageWithHeader].join(" ")}>
|
|
|
|
|
<header className={styles.header}>
|
|
|
|
|
<div className={styles.logoMark}>
|
|
|
|
|
<img src="/unicord.png"></img>
|
|
|
|
|
<div><span className={styles.logoMarkSpan}>uni</span>cord</div>
|
|
|
|
|
</div>
|
|
|
|
|
</header>
|
|
|
|
|
<main className={styles.main}>
|
|
|
|
|
<div className={styles.hero}>
|
|
|
|
|
<div>
|
|
|
|
|
<h1 className={styles.title}>
|
|
|
|
|
Welcome to <span className={styles.logoMarkSpan}>uni</span>cord
|
|
|
|
|
</h1>
|
|
|
|
|
<p className={styles.description}>
|
|
|
|
|
Finally a simpler way to build Discord bots.{" "}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2025-02-22 23:24:31 -06:00
|
|
|
<div className={styles.codeExample}>
|
2025-02-22 23:56:47 -06:00
|
|
|
<CodeExample code={simpleExample} noScroll={true} />
|
2025-02-22 22:56:09 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-02-22 23:24:31 -06:00
|
|
|
<div className={styles.pillars}>
|
2025-02-22 23:26:41 -06:00
|
|
|
<div className={styles.pillarContainer}>
|
|
|
|
|
<div className={styles.pillar}>
|
|
|
|
|
<div className={styles.pillarIcon}>⚡</div>
|
|
|
|
|
<h2>Simple</h2>
|
|
|
|
|
<p>Build Discord bots with minimal boilerplate and intuitive APIs</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={styles.pillar}>
|
|
|
|
|
<div className={styles.pillarIcon}>🔧</div>
|
|
|
|
|
<h2>Maintainable</h2>
|
|
|
|
|
<p>Type-safe, modular architecture that scales with your project</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={styles.pillar}>
|
|
|
|
|
<div className={styles.pillarIcon}>📈</div>
|
|
|
|
|
<h2>Scalable</h2>
|
|
|
|
|
<p>Efficient caching and event handling for bots of any size</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-22 22:56:09 -06:00
|
|
|
</div>
|
2025-02-22 23:32:23 -06:00
|
|
|
|
|
|
|
|
<div className={styles.hydrationSection}>
|
|
|
|
|
<div className={styles.hydrationContainer}>
|
|
|
|
|
<div className={styles.hydrationCode}>
|
2025-02-23 00:21:53 -06:00
|
|
|
<CodeExample code={hydrationExample} height={245} noScroll={true} />
|
2025-02-22 23:32:23 -06:00
|
|
|
</div>
|
|
|
|
|
<div className={styles.hydrationText}>
|
|
|
|
|
<h2>Smart Hydration</h2>
|
|
|
|
|
<p>
|
|
|
|
|
Unicord's hydration system automatically manages Discord object lifecycles.
|
2025-02-23 00:21:53 -06:00
|
|
|
The <code>context.hydrate</code> method intelligently fetches and caches Discord objects
|
2025-02-22 23:32:23 -06:00
|
|
|
like messages, users, and guilds, ensuring your bot stays efficient while
|
|
|
|
|
keeping your code clean and predictable.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-23 00:24:20 -06:00
|
|
|
|
|
|
|
|
<div className={styles.typeSection}>
|
|
|
|
|
<div className={styles.typeContainer}>
|
|
|
|
|
<div className={styles.typeText}>
|
|
|
|
|
<h2>Type Coercion</h2>
|
|
|
|
|
<p>
|
|
|
|
|
Unicord automatically handles type coercion for command arguments,
|
|
|
|
|
ensuring you always get the correct types in your handlers. Define your
|
|
|
|
|
command structure once, and get full type safety and autocompletion
|
|
|
|
|
throughout your codebase.
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
|
|
|
|
In this example, the <code>user</code> argument is automatically typed
|
|
|
|
|
as a <code>User</code> object, providing access to all user properties
|
|
|
|
|
with full TypeScript support.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={styles.typeCode}>
|
2025-02-23 00:27:31 -06:00
|
|
|
<CodeExample code={typeCoercionExample} height={370} noScroll={true} />
|
2025-02-23 00:24:20 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-22 22:56:09 -06:00
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|