Skip to content

Commit

Permalink
Update | Beta 5.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gncdev committed Sep 1, 2020
1 parent 25b5dea commit aaae009
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
9 changes: 9 additions & 0 deletions src/Interfaces/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,14 @@ public function getMessage($channel, $message_id)
return new Message($this->bot, $message_id, $channel);
}

/**
*
* @param $channel \Ourted\Model\Channel\Channel
* @return mixed
*/
public function deleteChannel($channel){
return json_decode($this->bot->api->init_curl_with_header("/channels/{$channel->id}","", "DELETE"));
}


}
25 changes: 19 additions & 6 deletions src/Interfaces/Guild.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Ourted\Interfaces;

use Ourted\Bot;
use Ourted\Model\Role\Role;

class Guild{

Expand Down Expand Up @@ -36,32 +37,44 @@ public function getGuild($id){
*
* @param $guild \Ourted\Model\Guild\Guild
* @param $role_id int|string
* @return \Ourted\Model\Role\Role
* @return Role
*/
public function getRole($guild, $role_id){
return new \Ourted\Model\Role\Role($this->bot, $guild, $role_id);
return new Role($this->bot, $guild, $role_id);
}

/**
*
* @param $guild \Ourted\Model\Guild\Guild
* @return \Ourted\Model\Role\Role
* @return Role
*/
public function getRoles($guild){
return new \Ourted\Model\Role\Role($this->bot, $guild);
return new Role($this->bot, $guild);
}


/**
*
* @param $guild \Ourted\Model\Guild\Guild
* @return mixed
*/
public function getChannels($guild){
return json_decode($this->bot->api->init_curl_with_header("guilds/{$guild->id}/channels","", "GET"));
}



/**
*
* @param \Ourted\Model\Guild\Guild $guild
* @param string $role_name
* @param int|string $color
* @param bool $mentionable
* @param bool $hoist
* @return \Ourted\Model\Role\Role
* @return Role
*/
public function addRole($guild, $role_name, $color, $mentionable, $hoist){
$result = json_decode($this->bot->api->init_curl_with_header("guilds/{$guild->id}/roles","{\"name\":\"{$role_name}\", \"color\":\"{$color}\", \"hoist\":{$hoist}, \"mentionable\":{$mentionable}}", "POST"));
return new \Ourted\Model\Role\Role($this->bot, $guild, $result->id);
return new Role($this->bot, $guild, $result->id);
}
}

0 comments on commit aaae009

Please sign in to comment.