Skip to content

Instantly share code, notes, and snippets.

View EvolutionX-10's full-sized avatar
:octocat:
Learning

Evo EvolutionX-10

:octocat:
Learning
View GitHub Profile
@EvolutionX-10
EvolutionX-10 / rps.ts
Last active September 21, 2022 08:19
RPS game for discord bot, following my discordbot template
import { CommandType } from '#lib/enums';
import { Command } from '#lib/structures';
import {
ActionRowBuilder,
ApplicationCommandOptionType,
ButtonBuilder,
ButtonInteraction,
ButtonStyle,
ComponentType,
User,
@EvolutionX-10
EvolutionX-10 / highlow.ts
Last active September 21, 2022 08:16
Highlow game for discord bot, following my discordbot template
import { CommandType } from '#lib/enums';
import { Command } from '#lib/structures';
import {
ActionRowBuilder,
APIButtonComponentWithCustomId,
ButtonBuilder,
ButtonInteraction,
ButtonStyle,
ComponentType,
} from 'discord.js';
@EvolutionX-10
EvolutionX-10 / Timestamp.ts
Created September 17, 2022 03:15
A simple class for Discord Timestamps
export class Timestamp {
/**
* Discord Timestamps
* @param timestamp The timestamp to convert to a readable string
* @requires [UNIX](https://en.wikipedia.org/wiki/Unix_time) timestamp in `milliseconds`
*/
public constructor(public readonly timestamp: number) {
if (this.timestamp < 0) throw new Error('Timestamp must be a positive number');
}
@EvolutionX-10
EvolutionX-10 / Prompt.ts
Last active September 21, 2022 06:17
An easy way of prompting series of questions
import { Message, User } from 'discord.js';
export class Prompt {
public constructor(public readonly options: PromptOptions) {
if (this.options.questions.length === 0)
throw new Error('No valid questions to prompt!');
this.options.time ??= 60_000;
}
@EvolutionX-10
EvolutionX-10 / Resolver.ts
Last active August 14, 2022 19:39
A resolver for string option in Chat Input Commands parsing mentions
import {
Collection,
CommandInteraction,
GuildBasedChannel,
GuildMember,
Role,
User,
} from 'discord.js';
import type { Snowflake } from 'discord-api-types/v10';
@EvolutionX-10
EvolutionX-10 / Paginator.ts
Last active September 6, 2023 14:38
An intermediate level discord.js Paginator made in v14
import {
ActionRow,
ActionRowBuilder,
APISelectMenuComponent,
APISelectMenuOption,
ButtonBuilder,
ButtonStyle,
CommandInteraction,
EmbedBuilder,
Message,