Skip to content

Instantly share code, notes, and snippets.

View peakh's full-sized avatar
🍉

Noah peakh

🍉
View GitHub Profile
@peakh
peakh / example.md
Last active August 12, 2023 03:44
Discord-supported codeblock languages in one interface in TypeScript.

Send the code block within a Discord channel:

import languages from "./languages";
import { codeBlock } from "discord.js";

return await interaction.reply({
	content: codeBlock(languages.Python, "Hello World!"),
	ephemeral: true
});
@peakh
peakh / pagination.ts
Last active January 22, 2023 06:15
Pagination with first page, previous, next, and last page buttons; includes automatic splicing within the other file.
import { ActionRowBuilder, ButtonBuilder, ButtonInteraction, ButtonStyle, ChatInputCommandInteraction, EmbedBuilder } from 'discord.js';
import colors from '../util/colors';
/**
*
* @param {ChatInputCommandInteraction} interaction
* @param {EmbedBuilder} embeds
* @param {ButtonBuilder} buttons
* @returns
*/