Merge pull request #511 from Seklfreak/add-guildchannelcreate-channeltype

BREAKING CHANGE - makes GuildChannelCreate use ChannelType (#510)
This commit is contained in:
Bruce 2018-04-04 10:00:13 -05:00 committed by GitHub
commit a9f8ccef5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -921,12 +921,12 @@ func (s *Session) GuildChannels(guildID string) (st []*Channel, err error) {
// GuildChannelCreate creates a new channel in the given guild
// guildID : The ID of a Guild.
// name : Name of the channel (2-100 chars length)
// ctype : Tpye of the channel (voice or text)
func (s *Session) GuildChannelCreate(guildID, name, ctype string) (st *Channel, err error) {
// ctype : Type of the channel
func (s *Session) GuildChannelCreate(guildID, name string, ctype ChannelType) (st *Channel, err error) {
data := struct {
Name string `json:"name"`
Type string `json:"type"`
Type ChannelType `json:"type"`
}{name, ctype}
body, err := s.RequestWithBucketID("POST", EndpointGuildChannels(guildID), data, EndpointGuildChannels(guildID))