Skip to content

Commit aaae009

Browse files
committed
Update | Beta 5.1.5
1 parent 25b5dea commit aaae009

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

src/Interfaces/Channel.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,14 @@ public function getMessage($channel, $message_id)
9090
return new Message($this->bot, $message_id, $channel);
9191
}
9292

93+
/**
94+
*
95+
* @param $channel \Ourted\Model\Channel\Channel
96+
* @return mixed
97+
*/
98+
public function deleteChannel($channel){
99+
return json_decode($this->bot->api->init_curl_with_header("/channels/{$channel->id}","", "DELETE"));
100+
}
101+
93102

94103
}

src/Interfaces/Guild.php

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Ourted\Interfaces;
44

55
use Ourted\Bot;
6+
use Ourted\Model\Role\Role;
67

78
class Guild{
89

@@ -36,32 +37,44 @@ public function getGuild($id){
3637
*
3738
* @param $guild \Ourted\Model\Guild\Guild
3839
* @param $role_id int|string
39-
* @return \Ourted\Model\Role\Role
40+
* @return Role
4041
*/
4142
public function getRole($guild, $role_id){
42-
return new \Ourted\Model\Role\Role($this->bot, $guild, $role_id);
43+
return new Role($this->bot, $guild, $role_id);
4344
}
4445

4546
/**
4647
*
4748
* @param $guild \Ourted\Model\Guild\Guild
48-
* @return \Ourted\Model\Role\Role
49+
* @return Role
4950
*/
5051
public function getRoles($guild){
51-
return new \Ourted\Model\Role\Role($this->bot, $guild);
52+
return new Role($this->bot, $guild);
5253
}
5354

55+
56+
/**
57+
*
58+
* @param $guild \Ourted\Model\Guild\Guild
59+
* @return mixed
60+
*/
61+
public function getChannels($guild){
62+
return json_decode($this->bot->api->init_curl_with_header("guilds/{$guild->id}/channels","", "GET"));
63+
}
64+
65+
66+
5467
/**
5568
*
5669
* @param \Ourted\Model\Guild\Guild $guild
5770
* @param string $role_name
5871
* @param int|string $color
5972
* @param bool $mentionable
6073
* @param bool $hoist
61-
* @return \Ourted\Model\Role\Role
74+
* @return Role
6275
*/
6376
public function addRole($guild, $role_name, $color, $mentionable, $hoist){
6477
$result = json_decode($this->bot->api->init_curl_with_header("guilds/{$guild->id}/roles","{\"name\":\"{$role_name}\", \"color\":\"{$color}\", \"hoist\":{$hoist}, \"mentionable\":{$mentionable}}", "POST"));
65-
return new \Ourted\Model\Role\Role($this->bot, $guild, $result->id);
78+
return new Role($this->bot, $guild, $result->id);
6679
}
6780
}

0 commit comments

Comments
 (0)