From 54b59d1168e79c8706b164194bc1a48ec49726e4 Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 9 May 2017 13:24:41 +0200 Subject: error handling --- views/match.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'views/match.js') diff --git a/views/match.js b/views/match.js index 8a04045..2dc55ec 100644 --- a/views/match.js +++ b/views/match.js @@ -15,13 +15,8 @@ const MatchView = module.exports; // match detail view module.exports = class extends View { - constructor(msg, matchid) { - super(msg); - this.matchid = matchid; - } - // return [[title, text], …] for rosters - static async text(match) { + async text(match) { let resps = []; for(let roster of match.rosters) { let winstr = "Won"; @@ -49,8 +44,8 @@ module.exports = class extends View { return embed; }; - async respond() { - const match = await api.getMatch(this.matchid); + async respond(matchid) { + const match = await api.getMatch(matchid); this.response = await util.respond(this.msg, await this.embed(match), this.response); return this.response; -- cgit v1.3.1