summaryrefslogtreecommitdiff
path: root/strings.js
blob: 546dfc0068a58f5c1e6765239e90efc728c56791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/node
/* jshint esnext:true */
"use strict";

const emoji = require("discord-emoji"),
    oneLine = require("common-tags").oneLine,
    Promise = require("bluebird"),
    api = require("./api"),
    util = require("./util");
const strings = module.exports;

const MATCH_HISTORY_LEN = parseInt(process.env.MATCH_HISTORY_LEN) || 3,
    PREVIEW = process.env.PREVIEW != "false",
    ROOTURL = (PREVIEW? "https://preview.vainsocial.com/":"https://vainsocial.com/");

// tell the user that they need to store their name
module.exports.unknown = (msg) =>
    `You're unknown to our service. Try ${util.usg(msg, "vme")}.`;

module.exports.notFound = (ign) =>
    `Could not find ${ign}.`;

module.exports.noMatches = (ign) =>
    `Could not find any casual/ranked matches for ${ign}.`;

module.exports.tooFewMatches = (ign) =>
    `Could not find that many casual/ranked matches for ${ign}.`;

module.exports.loading = (ign) =>
    `Loading data for ${ign}…`;

module.exports.emojiCount = [ emoji.symbols.one, emoji.symbols.two, emoji.symbols.three,
    emoji.symbols.four, emoji.symbols.five, emoji.symbols.six,
    emoji.symbols.seven, emoji.symbols.eight, emoji.symbols.nine,
    emoji.symbols.ten
];

module.exports.profile = "Profile";
module.exports.lastMatch = "Last Match";

// based on impact score float, return an Emoji
module.exports.emojifyScore = (score) => {
    if (score > 0.7) return emoji.people.heart_eyes;
    if (score > 0.6) return emoji.people.blush;
    if (score > 0.5) return emoji.people.yum;
    if (score > 0.3) return emoji.people.relieved;
    return emoji.people.upside_down;
};