Skip to content

Commit

Permalink
Merge pull request #35 from mostafasoufi/master
Browse files Browse the repository at this point in the history
Update conversations methods #34
  • Loading branch information
vluzrmos authored Dec 13, 2021
2 parents 707db20 + 905431e commit 724f1c9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
36 changes: 18 additions & 18 deletions src/Vluzrmos/SlackApi/Methods/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Channel extends SlackMethod implements SlackChannel
{
protected $methodsGroup = 'channels.';
protected $methodsGroup = 'conversations.';

/**
* This method archives a channel.
Expand Down Expand Up @@ -36,7 +36,7 @@ public function create($name)
* This method returns a portion of messages/events from the specified channel.
* To read the entire history for a channel, call the method with no `latest` or `oldest` arguments,
* and then continue paging using the instructions below.
* @see https://api.slack.com/methods/channels.history
* @see https://api.slack.com/methods/conversations.history
*
* @param string $channel Channel to fetch history for.
* @param int $count Number of messages to return, between 1 and 1000.
Expand All @@ -54,7 +54,7 @@ public function history($channel, $count = 100, $latest = null, $oldest = 0, $in
/**
* This method returns information about a team channel.
*
* @see https://api.slack.com/methods/channels.info
* @see https://api.slack.com/methods/conversations.info
*
* @param string $channel Channel to get info on
*
Expand All @@ -68,7 +68,7 @@ public function info($channel)
/**
* This method is used to invite a user to a channel. The calling user must be a member of the channel.
*
* @see https://api.slack.com/methods/channels.invite
* @see https://api.slack.com/methods/conversations.invite
*
* @param string $channel
* @param string $user
Expand All @@ -83,7 +83,7 @@ public function invite($channel, $user)
/**
* This method is used to join a channel. If the channel does not exist, it is created.
*
* @see https://api.slack.com/methods/channels.join
* @see https://api.slack.com/methods/conversations.join
*
* @param string $name Channel name to join in
*
Expand All @@ -97,7 +97,7 @@ public function join($name)
/**
* This method allows a user to remove another member from a team channel.
*
* @see https://api.slack.com/methods/channels.kick
* @see https://api.slack.com/methods/conversations.kick
*
* @param string $channel
* @param string $user
Expand All @@ -112,7 +112,7 @@ public function kick($channel, $user)
/**
* This method is used to leave a channel.
*
* @see https://api.slack.com/methods/channels.leave
* @see https://api.slack.com/methods/conversations.leave
*
* @param string $channel
*
Expand All @@ -124,12 +124,12 @@ public function leave($channel)
}

/**
* This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels.
* This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived conversations.
* The number of (non-deactivated) members in each channel is also returned.
*
* @see https://api.slack.com/methods/channels.list
* @see https://api.slack.com/methods/conversations.list
*
* @param int $exclude_archived Don't return archived channels.
* @param int $exclude_archived Don't return archived conversations.
*
* @return array
*/
Expand All @@ -139,12 +139,12 @@ public function all($exclude_archived = 1)
}

/**
* This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived channels.
* This method returns a list of all channels in the team. This includes channels the caller is in, channels they are not currently in, and archived conversations.
* The number of (non-deactivated) members in each channel is also returned.
*
* @see https://api.slack.com/methods/channels.list
* @see https://api.slack.com/methods/conversations.list
*
* @param int $exclude_archived Don't return archived channels.
* @param int $exclude_archived Don't return archived conversations.
*
* @return array
*/
Expand All @@ -156,7 +156,7 @@ public function lists($exclude_archived = 1)
/**
* This method moves the read cursor in a channel.
*
* @see https://api.slack.com/methods/channels.mark
* @see https://api.slack.com/methods/conversations.mark
*
* @param string $channel Channel to set reading cursor in.
* @param string|int $ts Timestamp of the most recently seen message.
Expand All @@ -174,7 +174,7 @@ public function mark($channel, $ts)
* The only people who can rename a channel are team admins, or the person that originally
* created the channel. Others will recieve a "not_authorized" error.
*
* @see https://api.slack.com/methods/channels.rename
* @see https://api.slack.com/methods/conversations.rename
*
* @param string $channel Channel to rename
*
Expand All @@ -190,7 +190,7 @@ public function rename($channel, $name)
/**
* This method is used to change the purpose of a channel. The calling user must be a member of the channel.
*
* @see https://api.slack.com/methods/channels.setPurpose
* @see https://api.slack.com/methods/conversations.setPurpose
*
* @param string $channel Channel to set the purpose of
* @param string $purpose The new purpose
Expand All @@ -205,7 +205,7 @@ public function setPurpose($channel, $purpose)
/**
* This method is used to change the topic of a channel. The calling user must be a member of the channel.
*
* @see https://api.slack.com/methods/channels.setTopic
* @see https://api.slack.com/methods/conversations.setTopic
*
* @param string $channel
* @param string $topic
Expand All @@ -220,7 +220,7 @@ public function setTopic($channel, $topic)
/**
* This method unarchives a channel. The calling user is added to the channel.
*
* @see https://api.slack.com/methods/channels.unarchive
* @see https://api.slack.com/methods/conversations.unarchive
*
* @param string $channel Channel to unarchive
*
Expand Down
6 changes: 3 additions & 3 deletions src/Vluzrmos/SlackApi/Methods/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Group extends Channel implements SlackGroup
{
protected $methodsGroup = 'groups.';
protected $methodsGroup = 'usergroups.';

/**
* This method opens a private group.
Expand Down Expand Up @@ -41,12 +41,12 @@ public function close($channel)
* - Adds all members of the existing group to the new group.
*
* This is useful when inviting a new member to an existing group while hiding all previous
* chat history from them. In this scenario you can call groups.createChild followed by groups.invite.
* chat history from them. In this scenario you can call usergroups.createChild followed by usergroups.invite.
*
* The new group will have a special parent_group property pointing to the original archived group.
* This will only be returned for members of both groups, so will not be visible to any newly invited members.
*
* @see https://api.slack.com/methods/groups.createChild
* @see https://api.slack.com/methods/usergroups.createChild
*
* @param $channel
*
Expand Down
2 changes: 1 addition & 1 deletion src/Vluzrmos/SlackApi/Methods/InstantMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function close($channel)
* This method returns a portion of messages/events from the specified channel.
* To read the entire history for a channel, call the method with no `latest` or `oldest` arguments,
* and then continue paging using the instructions below.
* @see https://api.slack.com/methods/channels.history
* @see https://api.slack.com/methods/conversations.history
*
* @param string $channel Channel to fetch history for.
* @param int $count Number of messages to return, between 1 and 1000.
Expand Down

0 comments on commit 724f1c9

Please sign in to comment.