Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Util): added formatters #5976

Merged
merged 2 commits into from Jun 30, 2021
Merged

Conversation

kyranet
Copy link
Member

@kyranet kyranet commented Jun 30, 2021

Please describe the changes this PR makes and why it should be merged:

ref: #5918

Usage:

const { Formatters } = require('discord.js');

Formatters.bold('Hello there');
// **Hello there**
const { Formatters: { bold, italic } } = require('discord.js');

bold(italic('General Kenobi!'));
// **_General Kenobi!_**

Or with TypeScript / ESM:

import { Formatters } from 'discord.js';

Formatters.codeBlock('You are a bold one.');
// ```\nYou are a bold one.```

Note: A namespace was used because it's the equivalent of export * as Formatters from './util/Formatters'; in TypeScript.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

@iCrawl iCrawl merged commit 8c7a28f into discordjs:master Jun 30, 2021
@kyranet kyranet deleted the feat/added-formatters branch June 30, 2021 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants