-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : string possibility with interact #1199
base: master
Are you sure you want to change the base?
Conversation
|
||
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why ?
* Rename channel | ||
* | ||
* @param string $name | ||
* @return ExtendedPromiseInterface | ||
*/ | ||
public function rename(string $name): ExtendedPromiseInterface | ||
{ | ||
if ($this->name === $name) { | ||
return reject(new InvalidOverwriteException('The name is already set in the channel.')); | ||
} | ||
|
||
$this->name = $name; | ||
return $this->http->patch(Endpoint::bind(Endpoint::CHANNEL, $this->id),[ | ||
'name' => $this->name | ||
]); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree with this, there is already $channel->name
setter and save()
we cant let adding every function for changing every simple attribute like this
people would make multiple different http calls just to update a channel information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please uncommit the rename() method, besides the reasons i mentioned in the comment above, it is also out of the PR scope
Subtlety, but which allows a tremendous time-saving on large bot projects with this API :)