forked from pothtonswer/discordmuffin
Merge pull request #511 from Seklfreak/add-guildchannelcreate-channeltype
BREAKING CHANGE - makes GuildChannelCreate use ChannelType (#510)
This commit is contained in:
commit
a9f8ccef5f
1 changed files with 4 additions and 4 deletions
|
@ -921,12 +921,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))
|
||||||
|
|
Loading…
Reference in a new issue