Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lezdcs/twitch_chat
💬 Flutter Package for Twitch Chat
https://github.com/lezdcs/twitch_chat
flutter irc irl irllink twitch
Last synced: 6 days ago
JSON representation
💬 Flutter Package for Twitch Chat
- Host: GitHub
- URL: https://github.com/lezdcs/twitch_chat
- Owner: LezdCS
- License: mit
- Created: 2023-04-30T18:32:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-23T18:06:36.000Z (3 months ago)
- Last Synced: 2024-10-25T02:50:09.139Z (3 months ago)
- Topics: flutter, irc, irl, irllink, twitch
- Language: Dart
- Homepage: https://pub.dev/packages/twitch_chat
- Size: 139 KB
- Stars: 4
- Watchers: 0
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# twitch_chat
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/twitch_chat?color=%23027DFD)
![GitHub last commit](https://img.shields.io/github/last-commit/lezdcs/twitch_chat)
![GitHub](https://img.shields.io/github/license/lezdcs/twitch_chat?color=%236441a5)Package to connect and use the Twitch Chat by Websocket and IRC.
## Features
- [x] Connect to chat
- [x] Connect anonymously
- [x] Get badges
- [x] Get emotes
- [x] Get BTTV, FFZ & 7TV emotes
- [x] Ban, Timeout, Delete message## Getting started
- Get your access token
- Use the following scopes:## Usage
Initialize the chat
```dart
TwitchChat twitchChat = TwitchChat(
channelToJoin,
yourUsername,
accessToken,
clientId: clientId,
onConnected: () {},
onClearChat: () {},
onDeletedMessageByUserId: (String? userId) {},
onDeletedMessageByMessageId: (String? messageId) {},
onDone: () {},
onError: () {},
params: TwitchChatParameters(addFirstMessages: true),
);
```Connect to the chat
```dart
twitchChat.connect();
```Listen to new chat messages
```dart
twitchChat.chatStream.listen((message) {});
```Listen to connection status updates
```dart
twitchChat!.isConnected.addListener(() {
if (twitchChat.isConnected.value) {
} else {
}
});
```Send a message
```dart
twitchChat.sendMessage(message);
```Access emotes and badges
```dart
//Twitch emotes
twitchChat.emotes
twitchChat.emotesFromSets //contain all your subscriptions emotes
twitchChat.cheerEmotes//BTTV, 7TV, FFZ emotes (channel & global)
twitchChat.thirdPartEmotes//Global & channel badges
twitchChat.badges
```## Noticable applications using this package
- [irl-link](https://github.com/LezdCS/irl-link) for IRL streamers