1
+ using System . Collections . Generic ;
2
+ using System . Net . Http . Json ;
3
+ using System . Threading . Tasks ;
4
+ using Newtonsoft . Json ;
5
+
6
+ namespace FosscordSharp . Entities
7
+ {
8
+ public class Guild
9
+ {
10
+ internal FosscordClient _client ;
11
+ [ JsonProperty ( "id" ) ]
12
+ public string Id { get ; set ; }
13
+
14
+ [ JsonProperty ( "afk_channel_id" ) ]
15
+ public object AfkChannelId { get ; set ; }
16
+
17
+ [ JsonProperty ( "afk_timeout" ) ]
18
+ public int AfkTimeout { get ; set ; }
19
+
20
+ [ JsonProperty ( "banner" ) ]
21
+ public object Banner { get ; set ; }
22
+
23
+ [ JsonProperty ( "default_message_notifications" ) ]
24
+ public int DefaultMessageNotifications { get ; set ; }
25
+
26
+ [ JsonProperty ( "description" ) ]
27
+ public object Description { get ; set ; }
28
+
29
+ [ JsonProperty ( "discovery_splash" ) ]
30
+ public object DiscoverySplash { get ; set ; }
31
+
32
+ [ JsonProperty ( "explicit_content_filter" ) ]
33
+ public int ExplicitContentFilter { get ; set ; }
34
+
35
+ [ JsonProperty ( "features" ) ]
36
+ public List < object > Features { get ; set ; }
37
+
38
+ [ JsonProperty ( "icon" ) ]
39
+ public object Icon { get ; set ; }
40
+
41
+ [ JsonProperty ( "large" ) ]
42
+ public object Large { get ; set ; }
43
+
44
+ [ JsonProperty ( "max_members" ) ]
45
+ public int MaxMembers { get ; set ; }
46
+
47
+ [ JsonProperty ( "max_presences" ) ]
48
+ public int MaxPresences { get ; set ; }
49
+
50
+ [ JsonProperty ( "max_video_channel_users" ) ]
51
+ public int MaxVideoChannelUsers { get ; set ; }
52
+
53
+ [ JsonProperty ( "member_count" ) ]
54
+ public int MemberCount { get ; set ; }
55
+
56
+ [ JsonProperty ( "presence_count" ) ]
57
+ public int PresenceCount { get ; set ; }
58
+
59
+ [ JsonProperty ( "template_id" ) ]
60
+ public object TemplateId { get ; set ; }
61
+
62
+ [ JsonProperty ( "mfa_level" ) ]
63
+ public int MfaLevel { get ; set ; }
64
+
65
+ [ JsonProperty ( "name" ) ]
66
+ public string Name { get ; set ; }
67
+
68
+ [ JsonProperty ( "owner_id" ) ]
69
+ public string OwnerId { get ; set ; }
70
+
71
+ [ JsonProperty ( "preferred_locale" ) ]
72
+ public string PreferredLocale { get ; set ; }
73
+
74
+ [ JsonProperty ( "premium_subscription_count" ) ]
75
+ public int PremiumSubscriptionCount { get ; set ; }
76
+
77
+ [ JsonProperty ( "premium_tier" ) ]
78
+ public int PremiumTier { get ; set ; }
79
+
80
+ [ JsonProperty ( "public_updates_channel_id" ) ]
81
+ public object PublicUpdatesChannelId { get ; set ; }
82
+
83
+ [ JsonProperty ( "rules_channel_id" ) ]
84
+ public object RulesChannelId { get ; set ; }
85
+
86
+ [ JsonProperty ( "region" ) ]
87
+ public string Region { get ; set ; }
88
+
89
+ [ JsonProperty ( "splash" ) ]
90
+ public object Splash { get ; set ; }
91
+
92
+ [ JsonProperty ( "system_channel_id" ) ]
93
+ public object SystemChannelId { get ; set ; }
94
+
95
+ [ JsonProperty ( "system_channel_flags" ) ]
96
+ public int SystemChannelFlags { get ; set ; }
97
+
98
+ [ JsonProperty ( "unavailable" ) ]
99
+ public bool Unavailable { get ; set ; }
100
+
101
+ [ JsonProperty ( "verification_level" ) ]
102
+ public int VerificationLevel { get ; set ; }
103
+
104
+ // [JsonProperty("welcome_screen")]
105
+ // public WelcomeScreen WelcomeScreen { get; set; }
106
+
107
+ [ JsonProperty ( "widget_channel_id" ) ]
108
+ public object WidgetChannelId { get ; set ; }
109
+
110
+ [ JsonProperty ( "widget_enabled" ) ]
111
+ public bool WidgetEnabled { get ; set ; }
112
+
113
+ [ JsonProperty ( "nsfw_level" ) ]
114
+ public int NsfwLevel { get ; set ; }
115
+
116
+ [ JsonProperty ( "nsfw" ) ]
117
+ public bool Nsfw { get ; set ; }
118
+
119
+ public Guild ( )
120
+ {
121
+
122
+ }
123
+ public Guild ( FosscordClient client )
124
+ {
125
+ _client = client ;
126
+ }
127
+
128
+ public ulong id = 0 ;
129
+ public async Task < Channel [ ] > GetChannels ( )
130
+ {
131
+ Util . Log ( "GetChannels called on guild " + id ) ;
132
+ // await _client._httpClient.GetAsync($"");
133
+ // Util.LogDebug($"/guilds/{id}/channels");
134
+ // Util.LogDebug(await _client._httpClient.GetStringAsync($"/guilds/{id}/channels"));
135
+ var a = await _client . _httpClient . GetFromJsonAsync < Channel [ ] > ( $ "/api/guilds/{ id } /channels") ;
136
+ Util . Log ( a . Length + " channels" ) ;
137
+ return a ;
138
+ }
139
+ }
140
+ }
0 commit comments