Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var addEmoji = function (message) {
- var self = this;
- var emoticons = {
- "<3": "โค",
- "</3": "๐",
- "3:)": "๐",
- "3:-)": "๐",
- "3:(": "๐ฟ",
- "3:-(": "๐ฟ",
- "o:)": "๐",
- "o:-)": "๐",
- ":DD": "๐",
- ":-DD": "๐",
- ":D": "๐",
- ":-D": "๐",
- ":))": "๐",
- ":-))": "๐",
- ":)": "๐",
- ":-)": "๐",
- ";)": "๐",
- ";-)": "๐",
- ":(": "๐",
- ":-(": "๐",
- ":/": "๐",
- ":-/": "๐",
- ":p": "๐",
- ":-p": "๐",
- ";p": "๐",
- ";-p": "๐",
- ":#": "๐ค",
- ":-#": "๐ค",
- ":'(": "๐ข",
- ":'-(": "๐ข",
- ":*": "๐",
- ":-*": "๐",
- ":3": "๐",
- ":-3": "๐",
- "-_-": "๐",
- ":o": "๐ฎ",
- ":-o": "๐ฎ",
- "^_^": "๐",
- "(y)": "๐๐ป",
- "(n)": "๐๐ป"
- };
- for (var i in emoticons) {
- if (emoticons.hasOwnProperty(i)) {
- var regex = new RegExp(i.replace(/([()[{*+.$^\\|?])/g, '\\$1'), 'gim');
- message = message.replace(regex, emoticons[i]);
- }
- }
- return twemoji.parse(message);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement