forked from abalabahaha/eris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
145 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"use strict"; | ||
|
||
const Base = require("./Base"); | ||
|
||
/** | ||
* Represents a stage instance | ||
* @prop {StageChannel} channel The associated stage channel | ||
* @prop {Guild} guild The guild of the associated stage channel | ||
* @prop {String} id The ID of the stage instance | ||
* @prop {String} topic The stage instance topic | ||
*/ | ||
class StageInstance extends Base { | ||
constructor(data, client) { | ||
super(data.id); | ||
this.client = client; | ||
this.channel = client.getChannel(data.channel_id) || {id: data.channel_id}; | ||
this.guild = client.guilds.get(data.guild_id) || {id: data.guild_id}; | ||
this.topic = data.topic; | ||
} | ||
|
||
/** | ||
* Delete this stage instance | ||
* @returns {Promise} | ||
*/ | ||
delete() { | ||
return this.client.deleteStageInstance.call(this.client, this.channel.id); | ||
} | ||
|
||
/** | ||
* Update this stage instance | ||
* @arg {Object} options The properties to edit | ||
* @arg {String} options.topic The stage instance topic | ||
* @returns {Promise<StageInstance>} | ||
*/ | ||
edit(options) { | ||
return this.client.editStageInstance.call(this.client, options); | ||
} | ||
} | ||
|
||
module.exports = StageInstance; |