discord.js/src/index.js
2015-10-25 19:41:40 +00:00

34 lines
No EOL
723 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var request = require("superagent");
var Endpoints = require("./Endpoints.js");
var Client = require("./Client.js");
var Discord = {
Endpoints : Endpoints,
Client : Client
}
Discord.patchStrings = function () {
defineProperty("bold", "**");
defineProperty("underline", "__");
defineProperty("strike", "~~");
defineProperty("code", "`");
defineProperty("codeblock", "```");
defineProperty("newline", "\n");
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;