stormyCyanLeoponREADME.md3 matches
1# Send Chunked Discord Message
2This function is used to send a message to a Discord webhook. If the message exceeds the maximum character limit (2000 characters), it will be divided into chunks and sent as multiple messages.
34### Parameters
5message (string): The message to be sent to the Discord webhook.
6### Return Value
7This function does not return any value.
89## Example Usage:
13await @ktodaz.sendDiscordMessage(message);
14```
15In the above example, the sendDiscordMessage function is used to send the message to the Discord webhook. If the message exceeds 2000 characters, it will be split into smaller chunks and sent as separate messages.
1617## Required Secrets:
sendDiscordMessageREADME.md3 matches
1# Send Chunked Discord Message
2This function is used to send a message to a Discord webhook. If the message exceeds the maximum character limit (2000 characters), it will be divided into chunks and sent as multiple messages.
34### Parameters
5message (string): The message to be sent to the Discord webhook.
6### Return Value
7This function does not return any value.
89## Example Usage:
13await @ktodaz.sendDiscordMessage(message);
14```
15In the above example, the sendDiscordMessage function is used to send the message to the Discord webhook. If the message exceeds 2000 characters, it will be split into smaller chunks and sent as separate messages.
1617## Required Secrets:
sendDiscordMessagemain.tsx1 match
6webhook_url: string = process.env.discord_webhook,
7) => {
8function chunkString(str) {
9const chunks = [];
10let startIndex = 0;
aloneBronzeCattlemain.tsx3 matches
22const rest = new REST({ version: "9" }).setToken(process.env.DISCORD_BOT_TOKEN);
2324async function findUserVoiceChannel(guildId, userId) {
25try {
26const channels = await rest.get(Routes.guildChannels(guildId));
39}
4041async function sayMessage(guildId, channelId, message) {
42const url = googleTTS.getAudioUrl(message, {
43lang: "en",
68}
6970function createDiscordJSAdapter(channelId, guildId) {
71return {
72sendPayload: (payload) => {
aloneBronzeCattleREADME.md1 match
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
darkMagentaFlamingoREADME.md1 match
1Bot for Cama discord server. To initialize new slash commands, you have to run a separate bit of code. This is for modifying their functionality
convenientAzureSparrowmain.tsx2 matches
4const apiKey = "your_api_key";
56// Function to send SMS
7async function sendSMS(to, from) {
8try {
9const response = await axios.post(
numbergamemain.tsx4 matches
27const HUE_DIFF = 25;
2829function getColor(value: number): string {
30const power = Math.log2(value / 2);
31const hue = (power * HUE_DIFF) % 360;
33}
3435function App() {
36const [board, setBoard] = useState<number[][]>([]);
37const [selectedCells, setSelectedCells] = useState<[number, number][]>([]);
281}
282283function client() {
284createRoot(document.getElementById("root")).render(<App />);
285}
289}
290291async function server(request: Request): Promise<Response> {
292return new Response(
293`
easingbattlegroundmain.tsx23 matches
4import { BrowserRouter as Router, Route, Link, Routes } from "https://esm.sh/react-router-dom";
56function EasingVisualizer({ easing }) {
7const canvasRef = React.useRef(null);
813const height = canvas.height;
1415function drawCurve() {
16ctx.clearRect(0, 0, width, height);
17
18const [x1, y1, x2, y2] = easing.params;
19
20const bezierFunction = cubicBezier(x1, y1, x2, y2);
21
22ctx.beginPath();
23ctx.moveTo(0, height);
24for (let t = 0; t <= 1; t += 0.01) {
25const point = bezierFunction(t);
26const x = point.x * width;
27const y = height - point.y * height;
34// Animate the dot
35const time = (Date.now() % 3000) / 3000;
36const point = bezierFunction(time);
37const x = point.x * width;
38const y = height - point.y * height;
44}
4546const animationFrame = requestAnimationFrame(function animate() {
47drawCurve();
48requestAnimationFrame(animate);
55}
5657function cubicBezier(x1, y1, x2, y2) {
58return function(t) {
59const cx = 3 * x1;
60const bx = 3 * (x2 - x1) - cx;
72}
7374function EasingGuide() {
75return (
76<div className="bg-gray-100 p-6 rounded-lg mb-8">
92<h3 className="text-xl font-semibold mb-2">🧙♂️ Cubic-Bezier Magic:</h3>
93<p className="mb-4">
94Input your easing as a cubic-bezier function, like this:
95<code className="bg-gray-200 px-2 py-1 rounded">cubic-bezier(0.05, 0.00, 0.16, 0.13)</code>
96</p>
104}
105106function EasingForm({ onSubmit }) {
107const [newEasing, setNewEasing] = useState({ name: '', author: '', params: [0.05, 0.00, 0.16, 0.13] });
108109function handleSubmit(e) {
110e.preventDefault();
111onSubmit(newEasing);
113}
114115function handleCubicBezierInput(e) {
116const value = e.target.value;
117const match = value.match(/cubic-bezier\(([\d.]+),\s*([\d.]+),\s*([\d.]+),\s*([\d.]+)\)/);
125<form onSubmit={handleSubmit} className="mb-8">
126<div className="mb-4">
127<label htmlFor="easingInput" className="block mb-2 font-semibold">Easing Function (cubic-bezier format):</label>
128<input
129id="easingInput"
163}
164165function Leaderboard({ easings, onVote, votedEasings }) {
166return (
167<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
184}
185186function Home({ easings, onSubmit, onVote, votedEasings }) {
187return (
188<div>
200}
201202function FullLeaderboard({ easings, onVote, votedEasings }) {
203return (
204<div>
214}
215216function App() {
217const [easings, setEasings] = useState([]);
218const [votedEasings, setVotedEasings] = useState([]);
222}, []);
223224async function fetchEasings() {
225const response = await fetch('/easings');
226const data = await response.json();
228}
229230async function submitEasing(newEasing) {
231await fetch('/easings', {
232method: 'POST',
237}
238239async function vote(id, direction) {
240await fetch(`/vote/${id}/${direction}`, { method: 'POST' });
241setVotedEasings([...votedEasings, id]);
256}
257258function client() {
259createRoot(document.getElementById("root")).render(<App />);
260}
264}
265266async function server(request: Request): Promise<Response> {
267const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
268const SCHEMA_VERSION = 1
ChatGPTTextDefinitionUserscriptmain.tsx13 matches
11// ==/UserScript==
1213(function() {
14"use strict";
1571};
7273// Run the function when the page loads
74window.addEventListener("load", () => {
75console.log("Page loaded, running toggleStylesBasedOnWidth");
77});
7879// Also run the function when the window is resized
80window.addEventListener("resize", () => {
81console.log("Window resized, running toggleStylesBasedOnWidth");
201202// Stream processing
203async function* streamProcessor(reader) {
204const decoder = new TextDecoder();
205let buffer = "";
237238// API response handling
239async function processApiResponse(response) {
240const reader = response.body.getReader();
241253254// Selection handling
255async function handleSelection() {
256console.time("handleSelection");
257const selectedText = getSelectedText();
291}
292293// Helper functions
294function getSelectedText() {
295return window.getSelection().toString().trim();
296}
343};
344345// Function to create a new section and append it properly
346const showLoadingPopup = (selectedText) => {
347const popup = createPopup();
362};
363364function clearPreviousPopup() {
365const previousPopup = document.getElementById("definition-popup");
366if (previousPopup) {
427};
428429function createCloseButton() {
430console.log("Creating close button");
431463}
464465async function makeApiRequest(text) {
466console.log(`Preparing to send fetch request for text: "${text}"`);
467try {
482}
483484// Pure functions to calculate dimensions and positioning
485const calculateCharacterSize = () => {
486const tempElement = document.createElement("span");