-
Notifications
You must be signed in to change notification settings - Fork 787
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
Add ChannelEditComplex #493
Conversation
I think all possible attributes should be added. ( https://discordapp.com/developers/docs/resources/channel#modify-channel ) Missing right now: |
ChannelEdit struct has been updated to include all fields per @Seklfreak comment. |
2 things:
Thank you so much for this PR! |
Re. point 1, I havent heard them being called "file encodings", so for those who havent heard this, its the files permissions (as per *nix) that have been changed from 644 to 755. On that note, the image most definitely shouldnt need to be 755 |
Ah, sorry I didn't look closely, I've also seen this when the newline character (\n -> \r\n) changes, which is why I said encoding. |
I ran the files and its current live one through |
removed link
restapi.go
Outdated
|
||
body, err := s.RequestWithBucketID("PATCH", EndpointChannel(channelID), data, EndpointChannel(channelID)) | ||
// ChannelEditComplex edits an existing channel, replacing the parameters entirely with ChannelEdit struct | ||
func (s *Session) ChannelEditComplex(c *ChannelEdit) (st *Channel, err error) { |
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.
Sorry to be a pain, could we change this method signature to:
ChannelEditComplex(channel ID string, c *ChannelEdit)
We can then remove the ID field from the struct.
This would bring this API closer to the ChannelMessageSendComplex method.
Thanks!
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.
Not a pain, thank you for the feedback. This is a learning experience for me.
The current signature is mimicking ChannelMessageEditComplex:
func (s *Session) ChannelMessageEditComplex(m *MessageEdit) (st *Message, err error)
and the MessageEdit struct:
type MessageEdit struct {
Content *string `json:"content,omitempty"`
Embed *MessageEmbed `json:"embed,omitempty"`
ID string
Channel string
}
Should ChannelMessageEditComplex be rewritten to be inline with your suggestion?
Adding channelID seems to match the other functions.
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 see that changing ChannelMessageEditComplex will break the existing API.
Thanks so much! |
* Add ChannelEditComplex * Fixed comment format * gofmt * Reverted permissions and fixed ChannelEditComplex * Reverted Perms * Delete discordgo - Shortcut.lnk removed link * Added ChannelID param to ChannelEditComplex * gofmt
Add ChannelEditComplex function and ChannelEdit struct.
Allows updating a channel's fields such as topic.
Implemented as suggested by @iopred in #322 and #492