Telegram discussion
Embed a telegram discussions widget in your svelte application.
Demo
Code
1<script>
2 import { Discussions } from 'sveltegram';
3</script>
4
5<Discussions
6 link="https://t.me/contest/198"
7 color="#2f81f6"
8 colorDark="#89baff"
9 commentsLimit={5}
10/>API
Please refer to Telegram documentation for more details.
linkrequiredstring—- Telegram post link. You can copy it from context menu
pageURLstring—- As shown in Telegram docs, you can load comments dynamically if you have a channel that has discussions enabled and you post articles to it, you can set the
linkparameter to your channel link likehttps://t.me/computlyand Telegram will automatically fetch the discussions belonging to current article, you still need to pass current page full URL so the widget can be reactive to things like theme changes, as well as setting canonical<link>tag with current page URL. darkModebooleanfalse- Enable dark mode
colorstring#2f81f6- Accent color
colorDarkstring#89baff- Accent color in dark mode
colorfulNamesbooleanfalse- Use different color for usernames
commentsLimitnumber5- How many comments are displayed
heightnumber—- Widget height. The default value is 'auto' which is determined by Telegram