mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
3.9.0, chainable string modifiers
This commit is contained in:
23
lib/index.js
23
lib/index.js
@@ -9,4 +9,27 @@ var Discord = {
|
||||
Client: Client
|
||||
};
|
||||
|
||||
Discord.patchStrings = function () {
|
||||
|
||||
defineProperty("bold", "**");
|
||||
defineProperty("underline", "__");
|
||||
defineProperty("strike", "~~");
|
||||
defineProperty("code", "`");
|
||||
defineProperty("codeblock", "```");
|
||||
|
||||
Object.defineProperty(String.prototype, "italic", {
|
||||
get: function () {
|
||||
return "*" + this + "*";
|
||||
}
|
||||
});
|
||||
|
||||
function defineProperty(name, joiner) {
|
||||
Object.defineProperty(String.prototype, name, {
|
||||
get: function () {
|
||||
return joiner + this + joiner;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Discord;
|
||||
Reference in New Issue
Block a user