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/guild_create.js | |
| parent | f3aa08e72c6ffdb942ea06e21ac19e28b8cd5550 (diff) | |
| download | discordbot-31b4764cd5233acb25f4d0027261fe83eaad6ec7.tar.gz discordbot-31b4764cd5233acb25f4d0027261fe83eaad6ec7.zip | |
rewrite the whole thing (wip)
Diffstat (limited to 'views/guild_create.js')
| -rw-r--r-- | views/guild_create.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/views/guild_create.js b/views/guild_create.js new file mode 100644 index 0000000..9720191 --- /dev/null +++ b/views/guild_create.js @@ -0,0 +1,48 @@ +#!/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 GuildCreateView = module.exports; + +// match detail view +module.exports = class extends View { + constructor(msg, user_token) { + super(msg); + this.user_token = user_token; + } + + async text() { + return `Guild created. You can now use ${util.usg(this.msg, "vgadd ign1 ign2 ignN")} to add members to your Guild.`; + } + + async help() { + return `*${emoji.symbols.information_source} or ${util.usg(this.msg, "vgview")} to view your Guild*` + } + + async buttons() { + let reactions = {}; + reactions[emoji.symbols.information_source] = async () => { + util.trackAction(this.msg, "reaction-guildview"); + await new GuildOverviewView(this.user_token).respond(); + }; + return reactions; + } + + // TODO move to super class + async respond() { + this.response = await util.respond(this.msg, + await this.text(), this.response); + if (!this.hasButtons) { + await util.reactionButtons(this.response, + await this.buttons()); + this.hasButtons = true; + } + return this.response; + }; +} |
