diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-09 13:24:41 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-05-09 13:24:41 +0200 |
| commit | 54b59d1168e79c8706b164194bc1a48ec49726e4 (patch) | |
| tree | 82b685a4e934ba237db3abcdde51d6f8e2c1b993 /views/view.js | |
| parent | 31b4764cd5233acb25f4d0027261fe83eaad6ec7 (diff) | |
| download | discordbot-54b59d1168e79c8706b164194bc1a48ec49726e4.tar.gz discordbot-54b59d1168e79c8706b164194bc1a48ec49726e4.zip | |
error handling
Diffstat (limited to 'views/view.js')
| -rw-r--r-- | views/view.js | 10 |
1 files changed, 9 insertions, 1 deletions
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; } }; |
