diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-08 23:15:33 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-08 23:15:33 +0200 |
| commit | 31b4764cd5233acb25f4d0027261fe83eaad6ec7 (patch) | |
| tree | 75e7c33b8284d711fb9208154a1d8db8b931a0f3 /views/register.js | |
| parent | f3aa08e72c6ffdb942ea06e21ac19e28b8cd5550 (diff) | |
| download | discordbot-31b4764cd5233acb25f4d0027261fe83eaad6ec7.tar.gz discordbot-31b4764cd5233acb25f4d0027261fe83eaad6ec7.zip | |
rewrite the whole thing (wip)
Diffstat (limited to 'views/register.js')
| -rw-r--r-- | views/register.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/views/register.js b/views/register.js new file mode 100644 index 0000000..0e5ff71 --- /dev/null +++ b/views/register.js @@ -0,0 +1,41 @@ +#!/usr/bin/node +/* jshint esnext:true */ +"use strict"; + +const View = require("./view"), + 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 { + async text() { + return `You are now registered at VainSocial, ${this.msg.author.mention}.`; + } + 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"); + const ign = await util.ignForUser(undefined, this.msg.author.id); + await new PlayerView(this.msg, ign).respond(); + }; + return reactions; + } + async respond() { + await api.setUser(msg.author.id, ign); + this.response = await util.respond(this.msg, + await this.text(), this.response); + if (!this.hasButtons) { + await util.reactionButtons(this.response, + await this.buttons(player, matches)); + this.hasButtons = true; + } + return this.response; + }; +} |
