summaryrefslogtreecommitdiff
path: root/views/guild_progress.js
diff options
context:
space:
mode:
Diffstat (limited to 'views/guild_progress.js')
-rw-r--r--views/guild_progress.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/views/guild_progress.js b/views/guild_progress.js
new file mode 100644
index 0000000..b3fdeb3
--- /dev/null
+++ b/views/guild_progress.js
@@ -0,0 +1,30 @@
+#!/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 GuildMembersProgressView = module.exports;
+
+module.exports = class extends View {
+ constructor(msg, players) {
+ super(msg);
+ this.players = players;
+ }
+
+ // players: obj, key=ign, value=progress
+ async text(players) {
+ return Object.entries(players).map((tuple) =>
+ `${tuple[0]}: ${tuple[1]}`).join("\n");
+ }
+
+ async respond(extra="") {
+ this.response = await util.respond(this.msg,
+ await this.text(this.players) + "\n" + extra, this.response);
+ return this.response;
+ };
+}