Coder Social home page Coder Social logo

discord-text-formatter's Introduction

๐Ÿ‡ฉ ๐Ÿ‡ฎ ๐Ÿ‡ธ ๐Ÿ‡จ ๐Ÿ‡ด ๐Ÿ‡ท ๐Ÿ‡ฉ _ ๐Ÿ‡ซ ๐Ÿ‡ด ๐Ÿ‡ท ๐Ÿ‡ฒ ๐Ÿ‡ฆ ๐Ÿ‡น ๐Ÿ‡ช

Format text to emotes in Discord!

What is this?

Discord Formate is a web extension that helps to convert sentenses into their emote-equivalents.

How to use it?

  1. Download extension.
  2. Click on it or open option page.
  3. Type something.
  4. Formate & Copy
    Use screenshot
  5. Paste into Discord!

Input: Hell0 W0rld 1234
Output: ๐Ÿ‡ญ ๐Ÿ‡ช ๐Ÿ‡ฑ ๐Ÿ‡ฑ 0๏ธโƒฃ ๐Ÿ‡ผ 0๏ธโƒฃ ๐Ÿ‡ท ๐Ÿ‡ฑ ๐Ÿ‡ฉ 1๏ธโƒฃ 2๏ธโƒฃ 3๏ธโƒฃ 4๏ธโƒฃ

How does it work?

  • We map each characters to it's Unicode equivalent, and replace them.
  • Discord detects the Unicode, and renders it's own flavour of the characters.

Supported Characters

We use default emotes, so no Nitro or server-specified emotes required!

  • Any digits: 0-9
  • Any English alphabets: a-z
  • Question Mark: ?
  • Exclamation Mark: !

Spaces Replacement

We replace 1 space _ with 2 spaces __ or 6 spaces ______.
2 spaces if:

  • More than 28 emotes, or include non-emote (space excluded) characters.

This is due to the fact that Discord renders a smaller emote when either of these condition occurs, making 1 too small, and 6 too big.

Limitation

Discord has a character limit of 5000 before a message will be converted into a text file.

  • We need to separate each emote with a space, otherwise Discord will encode them differently.
    c d to cd_flag
  • We used to replace a with :regional_indicator_a:, and 1 with one instead of ๐Ÿ‡ฆ 1๏ธโƒฃ.

This puts us to around ~530 alphabets characters long per message.

Development

  • popup.js is the core component. It handles all the logic and interaction, from getting and parsing input to displaying and copying output to clipboard.
  • popup.html provides a structure for the interaction.
    It is both the Popup and the Option page.
<meta charset="UTF-8" />

Ensures that the Unicode will retain its encoding.

  • pages.css houses our CSS.
    It has minimal CSS declartion, mainly to make the interact good enough.
  • manifest.json is the manifest for our extension.
    Let more here.

discord-text-formatter's People

Contributors

dabreadman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.