summaryrefslogtreecommitdiff
path: root/views/match.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-05-09 13:24:41 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-05-09 13:24:41 +0200
commit54b59d1168e79c8706b164194bc1a48ec49726e4 (patch)
tree82b685a4e934ba237db3abcdde51d6f8e2c1b993 /views/match.js
parent31b4764cd5233acb25f4d0027261fe83eaad6ec7 (diff)
downloaddiscordbot-54b59d1168e79c8706b164194bc1a48ec49726e4.tar.gz
discordbot-54b59d1168e79c8706b164194bc1a48ec49726e4.zip
error handling
Diffstat (limited to 'views/match.js')
-rw-r--r--views/match.js11
1 files changed, 3 insertions, 8 deletions
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;