Skip to content

Commit 5e0c161

Browse files
authored
Merge pull request #568 from gitroomhq/feat/telegram
Added telegram
2 parents 339416f + 4009c89 commit 5e0c161

File tree

18 files changed

+2026
-5319
lines changed

18 files changed

+2026
-5319
lines changed

apps/backend/src/api/routes/integrations.controller.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import {
3636
RefreshToken,
3737
} from '@gitroom/nestjs-libraries/integrations/social.abstract';
3838
import { timer } from '@gitroom/helpers/utils/timer';
39+
import { TelegramProvider } from '@gitroom/nestjs-libraries/integrations/social/telegram.provider';
3940

4041
@ApiTags('Integrations')
4142
@Controller('/integrations')
@@ -609,4 +610,11 @@ export class IntegrationsController {
609610
) {
610611
return this._integrationService.changePlugActivation(org.id, id, status);
611612
}
613+
614+
@Get('/telegram/updates')
615+
async getUpdates(
616+
@Query() query: { word: string; id?: number },
617+
) {
618+
return new TelegramProvider().getBotId(query);
619+
}
612620
}
15.5 KB
Loading

apps/frontend/src/app/layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export default async function AppLayout({ children }: { children: ReactNode }) {
4242
uploadDirectory={process.env.NEXT_PUBLIC_UPLOAD_STATIC_DIRECTORY!}
4343
tolt={process.env.NEXT_PUBLIC_TOLT!}
4444
facebookPixel={process.env.NEXT_PUBLIC_FACEBOOK_PIXEL!}
45+
telegramBotName={process.env.TELEGRAM_BOT_NAME!}
4546
neynarClientId={process.env.NEYNAR_CLIENT_ID!}
4647
>
4748
<ToltScript />

apps/frontend/src/components/launches/add.edit.model.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ export const AddEditModal: FC<{
595595
)}
596596
>
597597
<Image
598-
src={selectedIntegrations?.[0]?.picture}
598+
src={selectedIntegrations?.[0]?.picture || '/no-picture.jpg'}
599599
className="rounded-full"
600600
alt={selectedIntegrations?.[0]?.identifier}
601601
width={32}

apps/frontend/src/components/launches/bot.picture.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export const BotPicture: FC<{
1717
const modal = useModals();
1818
const toast = useToaster();
1919
const [nick, setNickname] = useState(props.integration.name);
20-
const [picture, setPicture] = useState(props.integration.picture);
20+
const [picture, setPicture] = useState(props.integration.picture || '/no-picture.jpg');
2121

2222
const fetch = useFetch();
2323
const submitForm: FormEventHandler<HTMLFormElement> = useCallback(

apps/frontend/src/components/launches/calendar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ export const CalendarColumn: FC<{
634634
)}
635635
>
636636
<Image
637-
src={selectedIntegrations.picture}
637+
src={selectedIntegrations.picture || '/no-picture.jpg'}
638638
className="rounded-full"
639639
alt={selectedIntegrations.identifier}
640640
width={32}
@@ -747,7 +747,7 @@ const CalendarItem: FC<{
747747
>
748748
<img
749749
className="w-[20px] h-[20px] rounded-full"
750-
src={post.integration.picture!}
750+
src={post.integration.picture! || '/no-picture.jpg'}
751751
/>
752752
<img
753753
className="w-[12px] h-[12px] rounded-full absolute z-10 top-[10px] right-0 border border-fifth"

apps/frontend/src/components/launches/general.preview.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const GeneralPreviewComponent: FC<{maximumCharacters?: number}> = (props)
3333
>
3434
<div className="w-[40px] flex flex-col items-center">
3535
<img
36-
src={integration?.picture}
36+
src={integration?.picture || '/no-picture.jpg'}
3737
alt="x"
3838
className="rounded-full relative z-[2]"
3939
/>

apps/frontend/src/components/launches/helpers/pick.platform.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export const PickPlatforms: FC<{
263263
)}
264264
>
265265
<Image
266-
src={integration.picture}
266+
src={integration.picture || '/no-picture.jpg'}
267267
className="rounded-full"
268268
alt={integration.identifier}
269269
width={32}
@@ -302,7 +302,7 @@ export const PickPlatforms: FC<{
302302
<div className="flex items-center justify-center gap-[10px]">
303303
<div className="relative">
304304
<img
305-
src={integration.picture}
305+
src={integration.picture || '/no-picture.jpg'}
306306
className="rounded-full"
307307
alt={integration.identifier}
308308
width={24}

apps/frontend/src/components/launches/launches.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const MenuComponent: FC<
215215
)}
216216
<ImageWithFallback
217217
fallbackSrc={`/icons/platforms/${integration.identifier}.png`}
218-
src={integration.picture!}
218+
src={integration.picture || '/no-picture.jpg'}
219219
className="rounded-full"
220220
alt={integration.identifier}
221221
width={32}

apps/frontend/src/components/launches/providers/show.all.providers.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import MastodonProvider from '@gitroom/frontend/components/launches/providers/ma
1919
import BlueskyProvider from '@gitroom/frontend/components/launches/providers/bluesky/bluesky.provider';
2020
import LemmyProvider from '@gitroom/frontend/components/launches/providers/lemmy/lemmy.provider';
2121
import WarpcastProvider from '@gitroom/frontend/components/launches/providers/warpcast/warpcast.provider';
22+
import TelegramProvider from '@gitroom/frontend/components/launches/providers/telegram/telegram.provider';
2223

2324
export const Providers = [
2425
{identifier: 'devto', component: DevtoProvider},
@@ -42,6 +43,7 @@ export const Providers = [
4243
{identifier: 'bluesky', component: BlueskyProvider},
4344
{identifier: 'lemmy', component: LemmyProvider},
4445
{identifier: 'wrapcast', component: WarpcastProvider},
46+
{identifier: 'telegram', component: TelegramProvider},
4547
];
4648

4749

0 commit comments

Comments
 (0)