summaryrefslogtreecommitdiff
path: root/views/register.js
blob: a636e84f84ef4d2a630c3d7f12d0b3a423f3b1c8 (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
#!/usr/bin/node
/* jshint esnext:true */
"use strict";

const emoji = require("discord-emoji"),
    View = require("./view"),
    PlayerView = require("./player"),
    util = require("../util"),
    api = require("../api"),
    strings = require("../strings"),
    oneLine = require("common-tags").oneLine;

const RegisterView = module.exports;

// user register view
module.exports = class extends View {
    constructor(msg, ign) {
        super(msg);
        this.ign = ign;
    }

    async text() {
        return `You are now registered at VainSocial, ${this.msg.author.toString()}.`;
    }
    async help() {
        return `*${emoji.symbols.repeat} or ${util.usg(this.msg, "v")} to view your profile, ${util.usg(this.msg, "vgcreate")} to create a Guild*`
    }
    async buttons() {
        let reactions = {};
        reactions[emoji.symbols.repeat] = async () => {
            util.trackAction(this.msg, "reaction-player");
            await new PlayerView(this.msg, this.ign).respond();
        };
        return reactions;
    }
    async respond() {
        this.response = await util.respond(this.msg,
            await this.text() + "\n" + await this.help(), this.response);
        if (!this.hasButtons) {
            await util.reactionButtons(this.response,
                await this.buttons());
            this.hasButtons = true;
        }
        return this.response;
    };
}