Skip to content

Commit

Permalink
Merge pull request #40 from coupej/master
Browse files Browse the repository at this point in the history
Adding possibility to access other parameters from the channel call.
  • Loading branch information
vluzrmos committed Jun 5, 2023
2 parents 084f999 + ba3369d commit 993f647
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Vluzrmos/SlackApi/Contracts/SlackChannel.php
Expand Up @@ -13,8 +13,8 @@ public function invite($channel, $user);
public function join($name);
public function kick($channel, $user);
public function leave($channel);
public function all($exclude_archived = 1);
public function lists($exclude_archived = 1);
public function all($exclude_archived = 1, $options =[]);
public function lists($exclude_archived = 1, $options =[]);
public function mark($channel, $ts);
public function rename($channel, $name);
public function setPurpose($channel, $purpose);
Expand Down
11 changes: 6 additions & 5 deletions src/Vluzrmos/SlackApi/Methods/Channel.php
Expand Up @@ -130,12 +130,12 @@ public function leave($channel)
* @see https://api.slack.com/methods/conversations.list
*
* @param int $exclude_archived Don't return archived conversations.
*
* @param array $options ['limit' = 100, 'cursor' => "dXNlcjpVMDYxTkZUVDI=", types => "public_channel", "team_id"=>,T1234567890 ]
* @return array
*/
public function all($exclude_archived = 1)
public function all($exclude_archived = 1, $options = [])
{
return $this->method('list', compact('exclude_archived'));
return $this->method('list', array_merge(compact('exclude_archived'), $options));
}

/**
Expand All @@ -145,12 +145,13 @@ public function all($exclude_archived = 1)
* @see https://api.slack.com/methods/conversations.list
*
* @param int $exclude_archived Don't return archived conversations.
* @param array $options ['limit' = 100, 'cursor' => "dXNlcjpVMDYxTkZUVDI=", types => "public_channel", "team_id"=>,T1234567890 ]
*
* @return array
*/
public function lists($exclude_archived = 1)
public function lists($exclude_archived = 1, $options = [])
{
return $this->all($exclude_archived);
return $this->all($exclude_archived, $options);
}

/**
Expand Down

0 comments on commit 993f647

Please sign in to comment.