From 54b59d1168e79c8706b164194bc1a48ec49726e4 Mon Sep 17 00:00:00 2001 From: schneefux Date: Tue, 9 May 2017 13:24:41 +0200 Subject: error handling --- views/view.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'views/view.js') diff --git a/views/view.js b/views/view.js index 3d3ae38..771e3db 100644 --- a/views/view.js +++ b/views/view.js @@ -33,7 +33,15 @@ module.exports = class { // reply with embed + buttons this.response = await util.respond(this.msg, await this.embed(), this.response); - await util.reactionButtons(this.response, await this.buttons(), this.msg); + if (!this.hasButtons) { + await util.reactionButtons(this.response, await this.buttons(), this.msg); + this.hasButtons = true; + } + return this.response; + } + async error(text) { + // reply with error + this.response = await util.respond(this.msg, text, this.response); return this.response; } }; -- cgit v1.3.1