Telegram discussion

Embed a telegram discussions widget in your svelte application.

Demo

Code

Svelte
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.

link required
string
—
Telegram post link. You can copy it from context menu
pageURL
string
—
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 link parameter to your channel link like https://t.me/computly and 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.
darkMode
boolean
false
Enable dark mode
color
string
#2f81f6
Accent color
colorDark
string
#89baff
Accent color in dark mode
colorfulNames
boolean
false
Use different color for usernames
commentsLimit
number
5
How many comments are displayed
height
number
—
Widget height. The default value is 'auto' which is determined by Telegram