π¨ The ultimate agentic social media scheduling tool π€
TypeScript nextjsopen-sourceopen-source-social-media-scheduling-toolosspostiz-cloudpostiz-hostedredisscheduling-toolsocial-media-scheduling-tooltypescript
feat: who can reply to the post
Nevo Davidc892cb0ef285
diff --git a/apps/frontend/src/components/launches/providers/x/x.provider.tsx b/apps/frontend/src/components/launches/providers/x/x.provider.tsxindex d7f0d6415..ad50e0338 100644--- a/apps/frontend/src/components/launches/providers/x/x.provider.tsx+++ b/apps/frontend/src/components/launches/providers/x/x.provider.tsx@@ -1,8 +1,56 @@import { withProvider } from '@gitroom/frontend/components/launches/providers/high.order.provider';import { ThreadFinisher } from '@gitroom/frontend/components/launches/finisher/thread.finisher';+import { Select } from '@gitroom/react/form/select';+import { useT } from '@gitroom/react/translation/get.transation.service.client';+import { useSettings } from '@gitroom/frontend/components/launches/helpers/use.values';++const whoCanReply = [+ {+ label: 'Everyone',+ value: 'everyone',+ },+ {+ label: 'Accounts you follow',+ value: 'following',+ },+ {+ label: 'Mentioned accounts',+ value: 'mentionedUsers',+ },+ {+ label: 'Subscribers',+ value: 'subscribers',+ },+ {+ label: 'verified accounts',+ value: 'verified',+ }+]const SettingsComponent = () => {- return <ThreadFinisher />;+ const t = useT();+ const { register, watch, setValue } = useSettings();++ return (+ <>+ <Select+ label={t('label_who_can_reply_to_this_post', 'Who can reply to this post?')}+ className="mb-5"+ hideErrors={true}+ {...register('who_can_reply_post', {+ value: 'everyone',+ })}+ >+ {whoCanReply.map((item) => (+ <option key={item.value} value={item.value}>+ {item.label}+ </option>+ ))}+ </Select>++ <ThreadFinisher />+ </>+ );};export default withProvider(diff --git a/libraries/nestjs-libraries/src/integrations/social/x.provider.ts b/libraries/nestjs-libraries/src/integrations/social/x.provider.tsindex de4192b34..67891ab54 100644--- a/libraries/nestjs-libraries/src/integrations/social/x.provider.ts+++ b/libraries/nestjs-libraries/src/integrations/social/x.provider.ts@@ -241,6 +241,12 @@ export class XProvider extends SocialAbstract implements SocialProvider {postDetails: PostDetails<{active_thread_finisher: boolean;thread_finisher: string;+ who_can_reply_post:+ | 'everyone'+ | 'following'+ | 'mentionedUsers'+ | 'subscribers'+ | 'verified';}>[]): Promise<PostResponse[]> {const [accessTokenSplit, accessSecretSplit] = accessToken.split(':');@@ -299,6 +305,12 @@ export class XProvider extends SocialAbstract implements SocialProvider {// @ts-ignoreconst { data }: { data: { id: string } } = await client.v2.tweet({+ ...(!postDetails?.[0]?.settings?.who_can_reply_post ||+ postDetails?.[0]?.settings?.who_can_reply_post === 'everyone'+ ? {}+ : {+ reply_settings: postDetails?.[0]?.settings?.who_can_reply_post,+ }),text: post.message,...(media_ids.length ? { media: { media_ids } } : {}),...(ids.lengthdiff --git a/libraries/react-shared-libraries/src/translation/locales/en/translation.json b/libraries/react-shared-libraries/src/translation/locales/en/translation.jsonindex 33da524ee..f52fad35d 100644--- a/libraries/react-shared-libraries/src/translation/locales/en/translation.json+++ b/libraries/react-shared-libraries/src/translation/locales/en/translation.json@@ -485,5 +485,6 @@"that_a_wrap": "That's a wrap!\n\nIf you enjoyed this thread:\n\n1. Follow me @{{username}} for more of these\n2. RT the tweet below to share this thread with your audience\n","post_as_images_carousel": "Post as images carousel","save_set": "Save Set",- "separate_post": "Separate post to multiple posts"+ "separate_post": "Separate post to multiple posts",+ "label_who_can_reply_to_this_post": "Who can reply to this post?"}