makes GuildChannelCreate use ChannelType (#510)

This commit is contained in:
Sebastian Winkler 2018-02-22 14:44:09 +01:00
parent ffa9956c9b
commit eb11ffb51c
No known key found for this signature in database
GPG key ID: 6E5F12DD21107C1D

View file

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