Project Icon

Twitchat

增强Twitch直播互动的高级聊天管理工具

Twitchat是一款为Twitch直播设计的高级聊天管理工具,旨在弥补官方聊天功能的不足。它提供紧急按钮、自定义触发器、语音控制、文字转语音等功能,支持Stream Deck插件,可控制OBS和Spotify,创建投票和预测,管理抽奖活动。Twitchat致力于优化聊天室管理,增强主播与观众的互动体验,是提升Twitch直播质量的有力工具。







A custom twitch chat that aims to fill gaps in the official Twitch chat for streamers.
The main goal is to follow your chat as best as possible.

For developpers, Twitchat exposes an API to receive events and control some features remotely.
📖 Read its documentation.


Features

  • Enable an emergency button with custom actions to prevent from follow bots and doxxing
  • Create your own sub/follow/rewards/poll/... alerts and chat commands with the Trigger system that allows to control your OBS sources and filters as well as Spotify when an event occurs
  • Control Twitchat and create polls or predictions with your voice
  • Read your messages and alerts out loud thank to the include text-to-speech
  • Pin messages and find them back later
  • Display the first message of users seperatly so you don't forget to greet them
  • Show any message of your chat on your stream with a single click
  • Stream Deck™ plugin
  • Custom spoiler feature so viewers can hide message contents to the streamer
  • Alert command to make Twitchat shake, blink, emit sound and display a message over everything else
  • Edit your stream's info from Twitchat with possibility to create pressets
  • Create a timer or a countdown with a simple command and show it on your stream
  • Control spotify from chat commands (create your own song request system) and show currently playing track on your stream
  • Make it easier to follow a conversation between users
  • Remember where you stopped reading the chat by clicking any message
  • Track a user to make sure not to miss their messages
  • Create a raffle and pick random winners. An overlay is available to display a wheel that selects a winner.
  • Create a bingo in which users have to find a number or an emoji
  • Ask your viewers for suggestions with a dedicated command
  • See if a user is not following the channel
  • Display received whispers and answer them
  • Filter some messages (bots, commands, self, /me, etc...)
  • Customize messages display (remove badges, show minimalist badges, remove emotes)
  • Customize messages appearance by roles (viewers, mods, vips, subs)
  • Moderate messages (ban, timeout, delete message)
  • Allow/deny messages blocked by automod
  • Display when it's the first message ever of a user on the channel
  • Display mod notifications on chat (ex: "User XXX has been banned by YYY")
  • Display sub/bits/raid/reward/follow notifications
  • Display hype train status
  • Show the last stream info of a raider
  • Integrated activity feed to see subs/cheers/follows/raids/rewards history
  • Create/Delete polls
  • Create/Delete predictions
  • Emote selector
  • BTTV, FFZ and 7TV emotes supported
  • Message autocomplete nickname via "@", emotes via ":", commands via "/" or all via TAB key
  • Allow to search on all messages via command /search
  • Split view in half with chat on left and notifications/activity feed, new viewers, etc.. on the right
  • Filter out only specific commands
  • See live viewers count
  • Keep or remove deleted messages
  • See all your followings that are live to raid them easily
  • Supports boost trains
  • Supports /announce message feature
  • Allow your mods to control your OBS scenes or mute/unmute your mic from chat
  • Expose an API to control some stuff remotely
  • Chat suggestion feature: allow your viewers to give suggestions with a dedicated command and randomly pick one of them
  • Handles "low trust" feature (more info)
  • And many other things....



Project setup

Rename the credentials.default.json file within the credentials folder to credentials.json and fill in these values :

{
	"server_port": 3018,
	"admin_ids": ["YOUR_TWITCH_USER_ID"],
	"csrf_key": "",

	"twitch_client_id": "",
	"twitch_client_secret": "",
	"twitch_redirect_uri": "http://localhost:8080/oauth",
	"twitch_scopes": [
		"chat:read",
		"chat:edit",
		"moderator:manage:announcements",
		"moderator:manage:chat_messages",
		"moderator:manage:shoutouts",
		"whispers:read",
		"user:manage:whispers",
		"moderator:read:chatters",
		"channel:read:redemptions",
		"channel:manage:redemptions",
		"channel:manage:polls",
		"channel:manage:predictions",
		"moderator:manage:chat_settings",
		"channel:moderate",
		"moderation:read",
		"channel:manage:moderators",
		"channel:manage:vips",
		"channel:manage:raids",
		"channel:manage:broadcast",
		"channel:read:hype_train",
		"channel:edit:commercial",
		"channel:read:subscriptions",
		"user:read:emotes",
		"user:read:follows",
		"moderator:read:followers",
		"user:read:moderated_channels",
		"user:read:blocked_users",
		"user:manage:blocked_users",
		"user:edit:broadcast",
		"moderator:manage:banned_users",
		"moderator:manage:automod",
		"moderator:manage:shield_mode",
		"moderator:manage:unban_requests",
		"clips:edit",
		"channel:read:ads",
		"channel:manage:ads",
		"moderator:manage:blocked_terms"
	],

	"spotify_client_id": "",
	"spotify_client_secret": "",
	"spotify_scopes": "user-read-currently-playing user-modify-playback-state playlist-read-private playlist-modify-public playlist-modify-private",
	"spotify_redirect_uri": "http://localhost:8080/spotify/auth",

	"patreon_client_id": "",
	"patreon_client_secret": "",
	"patreon_scopes": "identity identity.memberships",
	"patreon_redirect_uri": "http://localhost:8080/patreon/auth",

	"patreon_client_id_server": "",
	"patreon_client_secret_server": "",
	"patreon_redirect_uri_server": "http://localhost:3018/api/patreon/serverauth",
	"patreon_webhook_secret": "",

	"tenor_secret": "",
	"youtube_key": "path/to/key.json",
	"youtube_scopes": ["https://www.googleapis.com/auth/youtube.readonly", "https://www.googleapis.com/auth/youtube.force-ssl"],
	"google_key": "path/to/key.json",

	"paypal_client_id":"",
	"paypal_client_secret":"",

	"donors_remote_api_secret": "",
	"contact_mail": "",

	"discord_client_id":"",
	"discord_public_key":"",
	"discord_bot_token":"",

	"streamlabs_client_id":"",
	"streamlabs_client_secret":"",
	"streamlabs_redirect_uri":"",

	"streamelements_client_id":"",
	"streamelements_client_secret":""
}

Create a twitch application and fill in the client_id and client_secret values.
Write anything you want in the csrf_key field, it will be used to secure twitch authentication from CSRF attacks.
Configure the redirect URI of the twitch application to:\

http://localhost:8080/oauth

(adapt with the proper port and domain if deploying online)
Set the same value to the redirect_uri property of the credentials.json file.\

You can also create a spotify application and fill in the spotify spotify_client_id and spotify_client_secret
By default the server listens on port 3018, you can change it on credentials.json and src_front/utils/Config.ts.




Environment setup

This project has been coded with VSCode.
It is recommended to install these plugins:
TypeScript Vue Plugin: https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin

I18n-ally Plugin: https://marketplace.visualstudio.com/items?itemName=lokalise.i18n-ally




Compile project

Install dependencies

npm install

Compiles and hot-reloads for development

npm run dev

Compiles and minifies for production

npm run build

Run server

node server/boostrap.js



Install server

All the following MUST be done on a seperate folder from the GIT project.
Compile the project and push the content of the server folder on your server root.
Next to this file, create a public folder and push the content of your local dist folder inside it.
Also add the credentials folder inside a data older at the root of the project.
Create an env.conf file, just write prod inside, and push it at the root of the project.
Install all the production dependencies and run the server.
Here is the expected file structure:
─ root
  ├─ node_modules/
  ├─ public/
  ├─ utils/
  ├─ data/
    ├─ credentials/
  ├─ controllers/
  ├─ bootstrap.js
  ├─ env.conf



Localization

Adding new language

Just create a new folder under the i18n folder with the ISO 639-1 code of the language.
Read the next section to know how to translate labels

Translating labels

To make localization as easy as possible, a dedicated interface has been made that lists all available categories and labels with the possibility to edit them.
Any update on this interface triggers a rebuild of the compiled file as well as an update on any twitchat page opened on the same browser.

The interface is only accessible to adminitrators and can be found here:
localhost:8080/labels
To get admin rights you must set your twitch user ID under the admin_ids array in the credentials.json file.\

Adding new labels

If you need to add new labels, you'll have to edit JSON sources.
All label files can be found under i18n folder.
They are splitted by language then by sections.
Any new file or folder structure can be added to this.
These are all merged into static/labels.json during the build process.

Files can have any name but all labels within it must be under a single property that will be the base path to use the label. The property name is usually the same as the file's name.
Example:

─ en\
  ├─ global.json\
  ├─ home.json/\
  ├─ triggers.json/\

global.json example:

{
	"global":{
		"hello":"World"
	}
}

home.json example:

{
	"home":{
		"lorem":"ipsum dolor sit amet"
	}
}

This will output this JSON file:

{
	"en":{
		"global":{
			"hello":"World"
		},
		"hello":{
			"lorem":"ipsum dolor sit amet"
		}
	}
}



Package Stream Deck™ plugin

Run the following command:

npm run streamdeck_package

The compiled plugin will be there

项目侧边栏1项目侧边栏2
推荐项目
Project Cover

豆包MarsCode

豆包 MarsCode 是一款革命性的编程助手,通过AI技术提供代码补全、单测生成、代码解释和智能问答等功能,支持100+编程语言,与主流编辑器无缝集成,显著提升开发效率和代码质量。

Project Cover

AI写歌

Suno AI是一个革命性的AI音乐创作平台,能在短短30秒内帮助用户创作出一首完整的歌曲。无论是寻找创作灵感还是需要快速制作音乐,Suno AI都是音乐爱好者和专业人士的理想选择。

Project Cover

白日梦AI

白日梦AI提供专注于AI视频生成的多样化功能,包括文生视频、动态画面和形象生成等,帮助用户快速上手,创造专业级内容。

Project Cover

有言AI

有言平台提供一站式AIGC视频创作解决方案,通过智能技术简化视频制作流程。无论是企业宣传还是个人分享,有言都能帮助用户快速、轻松地制作出专业级别的视频内容。

Project Cover

Kimi

Kimi AI助手提供多语言对话支持,能够阅读和理解用户上传的文件内容,解析网页信息,并结合搜索结果为用户提供详尽的答案。无论是日常咨询还是专业问题,Kimi都能以友好、专业的方式提供帮助。

Project Cover

讯飞绘镜

讯飞绘镜是一个支持从创意到完整视频创作的智能平台,用户可以快速生成视频素材并创作独特的音乐视频和故事。平台提供多样化的主题和精选作品,帮助用户探索创意灵感。

Project Cover

讯飞文书

讯飞文书依托讯飞星火大模型,为文书写作者提供从素材筹备到稿件撰写及审稿的全程支持。通过录音智记和以稿写稿等功能,满足事务性工作的高频需求,帮助撰稿人节省精力,提高效率,优化工作与生活。

Project Cover

阿里绘蛙

绘蛙是阿里巴巴集团推出的革命性AI电商营销平台。利用尖端人工智能技术,为商家提供一键生成商品图和营销文案的服务,显著提升内容创作效率和营销效果。适用于淘宝、天猫等电商平台,让商品第一时间被种草。

Project Cover

AIWritePaper论文写作

AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。

投诉举报邮箱: service@vectorlightyear.com
@2024 懂AI·鲁ICP备2024100362号-6·鲁公网安备37021002001498号