@@ -26,7 +26,7 @@ public function __construct($bot)
2626
2727 public function get_guilds_properties ()
2828 {
29- return json_decode ($ this ->bot ->api ->init_curl_with_header (
29+ return json_decode ($ this ->bot ->api ->send (
3030 "users/@me/guilds " ,
3131 "" , "GET " ));
3232 }
@@ -65,7 +65,7 @@ public function getRoles($guild)
6565 */
6666 public function getChannels ($ guild )
6767 {
68- return json_decode ($ this ->bot ->api ->init_curl_with_header ("guilds/ {$ guild ->id }/channels " , "" , "GET " ));
68+ return json_decode ($ this ->bot ->api ->send ("guilds/ {$ guild ->id }/channels " , "" , "GET " ));
6969 }
7070
7171 /**
@@ -75,7 +75,7 @@ public function getChannels($guild)
7575 */
7676 public function getPrune ($ guild )
7777 {
78- return json_decode ($ this ->bot ->api ->init_curl_with_header ("guilds/ {$ guild ->id }/prunes " , "" , "GET " ));
78+ return json_decode ($ this ->bot ->api ->send ("guilds/ {$ guild ->id }/prunes " , "" , "GET " ));
7979 }
8080
8181 /**
@@ -85,7 +85,7 @@ public function getPrune($guild)
8585 */
8686 public function getInvites ($ guild )
8787 {
88- return json_decode ($ this ->bot ->api ->init_curl_with_header ("guilds/ {$ guild ->id }/invites " , "" , "GET " ));
88+ return json_decode ($ this ->bot ->api ->send ("guilds/ {$ guild ->id }/invites " , "" , "GET " ));
8989 }
9090
9191
@@ -111,7 +111,7 @@ public function getIntegrations($guild)
111111 */
112112 public function addRole ($ guild , $ role_name , $ color , $ mentionable , $ hoist )
113113 {
114- $ result = json_decode ($ this ->bot ->api ->init_curl_with_header ("guilds/ {$ guild ->id }/roles " , "{ \"name \": \"{$ role_name }\", \"color \": \"{$ color }\", \"hoist \": {$ hoist }, \"mentionable \": {$ mentionable }} " , "POST " ));
114+ $ result = json_decode ($ this ->bot ->api ->send ("guilds/ {$ guild ->id }/roles " , "{ \"name \": \"{$ role_name }\", \"color \": \"{$ color }\", \"hoist \": {$ hoist }, \"mentionable \": {$ mentionable }} " , "POST " ));
115115 return new Role ($ this ->bot , $ guild , $ result ->id );
116116 }
117117
@@ -126,7 +126,7 @@ public function addRole($guild, $role_name, $color, $mentionable, $hoist)
126126 */
127127 public function modifyRole ($ guild , $ role_name = null , $ color = null , $ mentionable = null , $ hoist = null )
128128 {
129- $ result = json_decode ($ this ->bot ->api ->init_curl_with_header ("guilds/ {$ guild ->id }/roles " , "{ \"name \": \"{$ role_name }\", \"color \": \"{$ color }\", \"hoist \": {$ hoist }, \"mentionable \": {$ mentionable }} " , "PATCH " ));
129+ $ result = json_decode ($ this ->bot ->api ->send ("guilds/ {$ guild ->id }/roles " , "{ \"name \": \"{$ role_name }\", \"color \": \"{$ color }\", \"hoist \": {$ hoist }, \"mentionable \": {$ mentionable }} " , "PATCH " ));
130130 return new Role ($ this ->bot , $ guild , $ result ->id );
131131 }
132132
@@ -138,7 +138,7 @@ public function modifyRole($guild, $role_name = null, $color = null, $mentionabl
138138 */
139139 public function deleteRole ($ guild , $ role_id )
140140 {
141- $ result = json_decode ($ this ->bot ->api ->init_curl_with_header ("guilds/ {$ guild ->id }/roles/ {$ role_id }" , "" , "DELETE " ));
141+ $ result = json_decode ($ this ->bot ->api ->send ("guilds/ {$ guild ->id }/roles/ {$ role_id }" , "" , "DELETE " ));
142142 return new Role ($ this ->bot , $ guild , $ result ->id );
143143 }
144144
@@ -157,13 +157,13 @@ public function deleteRole($guild, $role_id)
157157 * @param bool
158158 * @return \Ourted\Model\Channel\Channel
159159 */
160- public function createChannel ($ guild , $ channel_name , $ type = 0 , $ topic = "" , $ permissions = null , $ bitrate = null , $ user_limit = null , $ rate_limit_per_user = null , $ position = null , $ parent_id = null )
160+ public function createChannel ($ guild , $ channel_name , $ type = 0 , $ topic = "" , $ bitrate = null , $ user_limit = null , $ rate_limit_per_user = null , $ position = null , $ parent_id = null )
161161 {
162162 $ field = "" ;
163163 $ field .= "\"name \": \"$ channel_name \"" ;
164164 $ field .= ", \"type \": $ type " ;
165165 $ field .= ", \"topic \": \"{$ topic }\"" ;
166- if (!is_null ($ permissions )) {
166+ /* if (!is_null($permissions)) {
167167 if (isset($permissions[0])) {
168168 $__permissions = '';
169169 foreach ($permissions as $key => $item) {
@@ -175,14 +175,14 @@ public function createChannel($guild, $channel_name, $type = 0, $topic = "", $pe
175175 }
176176 $field .= ",\"permissions\": [{$__permissions}]";
177177 }
178- }
178+ }*/
179179 if (!is_null ($ bitrate )) {
180- if ($ type == $ this ->bot ->GUILD_VOICE ) {
180+ if ($ type == $ this ->bot ->CHANNEL_GUILD_VOICE ) {
181181 $ field .= ", \"bitrate \": {$ bitrate } " ;
182182 }
183183 }
184184 if (!is_null ($ user_limit )) {
185- if ($ type == $ this ->bot ->GUILD_VOICE ) {
185+ if ($ type == $ this ->bot ->CHANNEL_GUILD_VOICE ) {
186186 $ field .= ", \"user_limit \": {$ user_limit }" ;
187187 }
188188 }
@@ -195,7 +195,7 @@ public function createChannel($guild, $channel_name, $type = 0, $topic = "", $pe
195195 if (!is_null ($ parent_id )) {
196196 $ field .= ", \"parent_id \": {$ parent_id }" ;
197197 }
198- $ result = json_decode ($ this ->bot ->api ->init_curl_with_header (
198+ $ result = json_decode ($ this ->bot ->api ->send (
199199 "guilds/ {$ guild ->id }/channels " , "
200200 { {$ field }} " , "POST " ));
201201 return new \Ourted \Model \Channel \Channel ($ this ->bot , $ result ->id );
@@ -210,7 +210,7 @@ public function createChannel($guild, $channel_name, $type = 0, $topic = "", $pe
210210 */
211211 public function changeChannelPosition ($ guild , $ channel , $ position )
212212 {
213- $ result = json_decode ($ this ->bot ->api ->init_curl_with_header ("guilds/ {$ guild ->id }/channels " , "{ \"id \": {$ channel ->id }, \"position \": {$ position }} " , "PATCH " ));
213+ $ result = json_decode ($ this ->bot ->api ->send ("guilds/ {$ guild ->id }/channels " , "{ \"id \": {$ channel ->id }, \"position \": {$ position }} " , "PATCH " ));
214214 return new \Ourted \Model \Channel \Channel ($ this ->bot , $ result ->id );
215215 }
216216}
0 commit comments