1 module dcord.types.voice;
2 
3 import std.stdio;
4 
5 import dcord.types,
6        dcord.client;
7 
8 
9 alias VoiceStateMap = ModelMap!(string, VoiceState);
10 
11 /// Object representing a voice state
12 class VoiceState: IModel {
13   mixin Model;
14 
15   Snowflake guildID;
16   Snowflake channelID;
17   Snowflake userID;
18   string sessionID;
19   bool deaf;
20   bool mute;
21   bool selfDeaf;
22   bool selfMute;
23   bool suppress;
24 
25 
26   override string toString() { // stfu
27     return format("<VoiceState %s (%s / %s /%s)>",
28       this.sessionID,
29       this.guildID,
30       this.channelID,
31       this.userID);
32   }
33   
34   /// Get the guild of the voice state
35   @property Guild guild() {
36     return this.client.state.guilds[this.guildID];
37   }
38 
39   /// Get the channel of the voice state
40   @property Channel channel() {
41     return this.client.state.channels[this.channelID];
42   }
43 }