Skip to content

Commit e9f2660

Browse files
committed
feat: remove channel selection
1 parent 7e1e5f3 commit e9f2660

File tree

4 files changed

+6
-138
lines changed

4 files changed

+6
-138
lines changed

apps/frontend/src/components/new-launch/providers/kick/kick.channel.select.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

apps/frontend/src/components/new-launch/providers/kick/kick.provider.tsx

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,14 @@ import {
44
PostComment,
55
withProvider,
66
} from '@gitroom/frontend/components/new-launch/providers/high.order.provider';
7-
import { FC } from 'react';
8-
import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';
9-
import { KickChannelSelect } from '@gitroom/frontend/components/new-launch/providers/kick/kick.channel.select';
10-
import { KickDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/kick.dto';
11-
12-
const KickComponent: FC = () => {
13-
const form = useSettings();
14-
return (
15-
<div>
16-
<KickChannelSelect {...form.register('broadcasterUserId')} />
17-
</div>
18-
);
19-
};
207

218
export default withProvider({
229
postComment: PostComment.COMMENT,
10+
comments: 'no-media',
2311
minimumCharacters: [],
24-
SettingsComponent: KickComponent,
12+
SettingsComponent: undefined,
2513
CustomPreviewComponent: undefined,
26-
dto: KickDto,
14+
dto: undefined,
2715
checkValidity: undefined,
2816
maximumCharacters: 500,
2917
});
30-
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
import { IsDefined, IsString, MinLength } from 'class-validator';
2-
import { JSONSchema } from 'class-validator-jsonschema';
3-
4-
export class KickDto {
5-
@MinLength(1)
6-
@IsDefined()
7-
@IsString()
8-
@JSONSchema({
9-
description: 'Broadcaster user ID to post to',
10-
})
11-
broadcasterUserId: string;
12-
}
13-
1+
export class KickDto {}

libraries/nestjs-libraries/src/integrations/social/kick.provider.ts

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { SocialAbstract } from '@gitroom/nestjs-libraries/integrations/social.ab
99
import dayjs from 'dayjs';
1010
import { Integration } from '@prisma/client';
1111
import { KickDto } from '@gitroom/nestjs-libraries/dtos/posts/providers-settings/kick.dto';
12-
import { Tool } from '@gitroom/nestjs-libraries/integrations/tool.decorator';
1312
import { createHash, randomBytes } from 'crypto';
1413

1514
export class KickProvider extends SocialAbstract implements SocialProvider {
@@ -154,55 +153,13 @@ export class KickProvider extends SocialAbstract implements SocialProvider {
154153
};
155154
}
156155

157-
@Tool({
158-
description: 'Get list of channels/broadcasters the user can post to',
159-
dataSchema: [],
160-
})
161-
async channels(accessToken: string, params: any, id: string) {
162-
// For Kick, when using a user token, we need to know which broadcaster to post to
163-
// The user posting as themselves would post to their own channel
164-
// Try to get channels the user has access to
165-
166-
try {
167-
const response = await fetch('https://api.kick.com/public/v1/channels', {
168-
method: 'GET',
169-
headers: {
170-
Authorization: `Bearer ${accessToken}`,
171-
},
172-
});
173-
174-
if (response.ok) {
175-
const data = await response.json();
176-
const channels = data.data || [];
177-
return channels.map((channel: any) => ({
178-
id: String(
179-
channel.broadcaster_user_id || channel.user_id || channel.id
180-
),
181-
name: channel.slug || channel.username || channel.name,
182-
}));
183-
}
184-
} catch (e) {
185-
// Fall back to returning the authenticated user's info
186-
}
187-
188-
// If no channels found, return the user's own channel
189-
// The id parameter is the user's own ID from authentication
190-
return [
191-
{
192-
id: id,
193-
name: 'My Channel',
194-
},
195-
];
196-
}
197-
198156
async post(
199157
id: string,
200158
accessToken: string,
201159
postDetails: PostDetails[],
202160
integration: Integration
203161
): Promise<PostResponse[]> {
204162
const [firstPost] = postDetails;
205-
const broadcasterUserId = firstPost.settings.broadcasterUserId;
206163

207164
// Post chat message to Kick
208165
// Note: Kick chat doesn't support media attachments directly in messages
@@ -215,7 +172,7 @@ export class KickProvider extends SocialAbstract implements SocialProvider {
215172
body: JSON.stringify({
216173
type: 'user',
217174
content: firstPost.message.substring(0, 500), // Ensure max length
218-
broadcaster_user_id: parseInt(broadcasterUserId, 10),
175+
broadcaster_user_id: parseInt(id, 10),
219176
}),
220177
});
221178

@@ -240,7 +197,6 @@ export class KickProvider extends SocialAbstract implements SocialProvider {
240197
integration: Integration
241198
): Promise<PostResponse[]> {
242199
const [commentPost] = postDetails;
243-
const broadcasterUserId = commentPost.settings.broadcasterUserId;
244200

245201
// Kick supports reply_to_message_id for replies
246202
const response = await this.fetch('https://api.kick.com/public/v1/chat', {
@@ -252,7 +208,7 @@ export class KickProvider extends SocialAbstract implements SocialProvider {
252208
body: JSON.stringify({
253209
type: 'user',
254210
content: commentPost.message.substring(0, 500),
255-
broadcaster_user_id: parseInt(broadcasterUserId, 10),
211+
broadcaster_user_id: parseInt(id, 10),
256212
reply_to_message_id: lastCommentId || postId,
257213
}),
258214
});

0 commit comments

Comments
 (0)