diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-12-30 13:11:06 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-12-30 13:11:06 +0100 |
| commit | c6c5027865743328d0542246fef70e0fafe0f0f1 (patch) | |
| tree | 9348d4afa900c170aa534f602b6f7a823292a831 /views/guild_create.js | |
| parent | abd33f47fbbcc92610b83341c61f5d1911eed590 (diff) | |
| parent | 1881a2ecd48be772fd83b20068fe9946f1365eeb (diff) | |
| download | discordbot-develop.tar.gz discordbot-develop.zip | |
Merge branch 'master' into developdevelop
Diffstat (limited to 'views/guild_create.js')
| -rw-r--r-- | views/guild_create.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/views/guild_create.js b/views/guild_create.js new file mode 100644 index 0000000..38720e1 --- /dev/null +++ b/views/guild_create.js @@ -0,0 +1,49 @@ +#!/usr/bin/node +/* jshint esnext:true */ +"use strict"; + +const emoji = require("discord-emoji"), + 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.msg).respond(this.user_token); + }; + return reactions; + } + + // TODO move to super class + 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; + }; +} |
