Skip to content

Commit 12a6367

Browse files
committed
fix: 创建私密子频道传递的成员id bug
1 parent a71e9d3 commit 12a6367

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/apitest/channel_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestChannel(t *testing.T) {
2828
Type: dto.ChannelTypeText,
2929
Position: 0,
3030
ParentID: "0", // 父ID,正常应该找到一个分组ID,如果传0,就不归属在任何一个分组中
31-
}, nil,
31+
}, []string{testMemberID},
3232
)
3333
if err != nil {
3434
t.Error(err)

openapi/v1/channels.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (o *openAPI) DeleteChannel(ctx context.Context, channelID string) error {
8181
func (o *openAPI) CreatePrivateChannel(ctx context.Context, guildID string, value *dto.ChannelValueObject,
8282
userIds []string) (*dto.Channel, error) {
8383
value.PrivateType = dto.ChannelPrivateTypeAdminAndMember
84-
if len(userIds) == 0 {
84+
if len(userIds) != 0 {
8585
value.PrivateUserIDs = userIds
8686
value.PrivateType = dto.ChannelPrivateTypeOnlyAdmin
8787
}

0 commit comments

Comments
 (0)