{"id":14960614,"url":"https://github.com/getstream/stream-chat-unity","last_synced_at":"2025-10-26T16:04:50.765Z","repository":{"id":37842284,"uuid":"431119420","full_name":"GetStream/stream-chat-unity","owner":"GetStream","description":"💬 Unity Chat Plugin by Stream ➜  These assets are the solution for adding an in-game text chat system to your Unity game.","archived":false,"fork":false,"pushed_at":"2025-02-27T11:38:55.000Z","size":46347,"stargazers_count":84,"open_issues_count":1,"forks_count":10,"subscribers_count":23,"default_branch":"develop","last_synced_at":"2025-03-31T10:07:03.415Z","etag":null,"topics":["chat","game-chat","game-development","unity","unity-asset","unity-chat-asset","unity-chat-plugin","unity-component","unity-plugin"],"latest_commit_sha":null,"homepage":"https://getstream.io/chat/sdk/unity/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GetStream.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-23T13:52:26.000Z","updated_at":"2025-02-27T11:38:27.000Z","dependencies_parsed_at":"2024-12-24T07:12:23.532Z","dependency_job_id":"235f6590-f408-4614-bb7c-a16e4c0eed9f","html_url":"https://github.com/GetStream/stream-chat-unity","commit_stats":{"total_commits":591,"total_committers":4,"mean_commits":147.75,"dds":0.3908629441624365,"last_synced_commit":"cb80491371fe0ca16352093a950fa4dfd1639acf"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetStream%2Fstream-chat-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GetStream","download_url":"https://codeload.github.com/GetStream/stream-chat-unity/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640465,"owners_count":20971557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat","game-chat","game-development","unity","unity-asset","unity-chat-asset","unity-chat-plugin","unity-component","unity-plugin"],"created_at":"2024-09-24T13:22:36.922Z","updated_at":"2025-10-26T16:04:50.696Z","avatar_url":"https://github.com/GetStream.png","language":"C#","readme":"﻿\u003cp align=\"center\"\u003e\n  \u003cimg src=\"ReadmeAssets/256px.png\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    The official Unity SDK for \u003ca href=\"https://getstream.io/chat/sdk/unity/\"\u003eStream Chat\u003c/a\u003e.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://getstream.io/chat/sdk/unity/\"\u003eWebsite\u003c/a\u003e\n    |\n    \u003ca href=\"https://getstream.io/chat/unity/tutorial/\"\u003eTutorial\u003c/a\u003e\n    |\n    \u003ca href=\"https://getstream.io/chat/docs/unity/?language=unity\"\u003eSDK Documentation\u003c/a\u003e\n    |\n    \u003ca href=\"https://getstream.io/chat/trial/\"\u003eRegister for API Key\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/GetStream/stream-chat-unity/releases/latest\"\u003e\n        \u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/GetStream/stream-chat-unity\"\u003e\n    \u003c/a\u003e\n    \u0026nbsp;\n\t  \u003ca href=\"https://github.com/GetStream/stream-chat-unity/actions/workflows/main.ci.cd.workflow.yml\"\u003e\n        \u003cimg src=\"https://github.com/GetStream/stream-chat-unity/actions/workflows/main.ci.cd.workflow.yml/badge.svg?branch=develop\" alt=\"CI\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\nThe **Stream Chat SDK** is the official Unity SDK for [Stream Chat](https://getstream.io/chat/sdk/unity/), a service for building chat and messaging games and applications.\n\n- **Unity Engine 6, 2023.x, 2022.x, 2021.x, 2020.x, and 2019.x Support**\n- **IL2CPP** Support\n- **Automatic State Management** The Chat Client completely manages the state. You work with high-level models that simplify API interaction and are always up-to-date\n- **Automatic Reconnection** Whenever the connection is lost, the chat client will reconnect automatically when the network is back\n- **Realtime** Highly responsive experience using Websockets\n- **Messaging:** Send direct or group messages, and have the messages persist across sessions\n- **Channels:** group channels, private messages, etc.\n- **Reactions:** Multiple users can react to every message, custom reactions\n- **Moderation:** Banning (temporary, permanent, shadow), Muting (users, channels), Flagging (messages, users)\n- **Roles \u0026 Permissions:** Admins, Moderators, custom roles with custom permission\n- **Moderation Dashboard** Dedicated web panel to handle moderation\n- **Search** Search through message history \n- **Unread counts** Show the last read message per user and count unread messages\n- **Typing indicators** See who's currently writing a new message\n- **Fully open-source**: Complete access to the SDK source code here on GitHub\n\n## IL2CPP\nIL2CPP is supported :rocket:\n\n## WebGL\nWebGL is supported :rocket:\n\n## Free for Indie Developers\n\nStream is free for most side and hobby projects. You can use Stream Chat for free with less than five team members and no more than $10,000 in monthly revenue. Visit our website and [apply for the Makers Account](https://getstream.io/maker-account/).\n\n## Getting Started\n\n1. Download the [latest release .unitypackage](https://github.com/GetStream/stream-chat-unity/releases/latest).\n2. Launch Unity Editor and import the downloaded `.unitypackage`\n3. Resolve [dependencies](https://github.com/GetStream/stream-chat-unity#dependencies)\n4. Start integrating Chat into your project! Check out the [Tutorial](https://getstream.io/chat/unity/tutorial/) to get yourself going.\n\n## Tutorial\nCheck out our [tutorial](https://getstream.io/chat/unity/tutorial/) on how to setup your project and perform basic operations.\n\n## Sample Project\n\nIn the `StreamChat/SampleProject` folder you'll find a fully working chat example featuring:\n- Browsing channels and messages\n- Sending, Editing, Deleting messaged\n- Message right-click context menu\n- Reactions/Emojis\n- Member list with online status\n- Typing indicators\n- Moderation: flagging messages and users\n- Sending video attachments (works only in Editor)\n\n### Preview\n![image](https://user-images.githubusercontent.com/33436839/219688055-b53c6e19-6c7e-4f31-b27f-a04bdfa0e45b.png)\n\nCreated with Unity's UGUI UI system and supports both legacy and the new Unity's Input System. \n\n### How to run it?\n1. [Register](https://getstream.io/try-for-free/) an account and go to [Stream Dasboard](https://getstream.io/dashboard/)\n2. Create App and go to its **Chat Explorer** throught the Dashboard\n3. Create new chat user and save its **id**\n4. Use our [online token generator](https://getstream.io/chat/docs/unity/tokens_and_authentication/?language=unity#manually-generating-tokens) to create user token\n5. In Unity, provide: **Api Key**, **User Id** and **User Token** into `StreamChat/SampleProject/Config/DemoCredentials.asset`\n6. Open `StreamChat/SampleProject/Scenes/ChatDemo.scene` and hit play\n\nHow to enable Unity's **[new Input System](https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/index.html)**?:\n1. Make sure that the UnityEngine.InputSystem package is available in the project\n2. Add **UnityEngine.InputSystem** dll reference to the **StreamChat.Unity** assembly definition asset\n\n## Dependencies\n\n- **TextMeshPro** StreamChat/SampleProject requires a TextMeshPro package\n- **Newtonsoft.Json** SDK uses [Unity's package for Newtonsoft Json]([com.unity.nuget.newtonsoft-json@3.0](https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html)) Library for serialization.\n\n:warning: In case you already have the Newtonsoft Json dll or package in your project and encounter the following error:\u003cbr\u003e\n`Multiple precompiled assemblies with the same name Newtonsoft.Json.dll included or the current platform. Only one assembly with the same name is allowed per platform.`\n\u003cbr\u003eyou can remove the `StreamChat\\Libs\\Serialization\\com.unity.nuget.newtonsoft-json@3.0.2` directory. Please note however, that Unity's package for Newtonsoft Json has IL2CPP support. If you wish to replace it and still use IL2CPP, make sure that the Json implementaion of your choice does support IL2CPP as well.\n\n## Short Documentation (Cookbook)\nHere are some quick Code Samples to get you started. For detailed information please check out our [Documentation](https://getstream.io/chat/docs/unity/?language=unity)\n\n#### Vocabulary:\n* `StreamChatClient` - the main chat manager that allows you to connect with the Stream Chat Server, create channels, query channels, users, and members based on provided criteria\n* `StreamChannel` - channels group users in a conversation. Depending on your settings users may need to join channels as members in order to send messages\n* `StreamUser` - represent a single user within your application\n* `StreamChannelMember` - object representing a user that is a member of a specific channel. This object contains property `member.User` to access the user object\n* `StreamMessage` - represents a single message within a channel\n\n### Create an instance of chat client\nUser the `StreamChatClient.CreateDefaultClient();` factory method to create an instance of `IStreamChatClient`:\n```csharp\npublic class ChatManager : MonoBehaviour\n{\n    public IStreamChatClient Client { get; private set; }\n        \n    protected void Awake()\n    {\n        Client = StreamChatClient.CreateDefaultClient();\n    }\n}\n```\n\n### Connect the user\nEasiest way to start is to enable [developer authorization](https://getstream.io/chat/docs/unity/tokens_and_authentication/?language=unity#developer-tokens) and connect with client-side generated auth tokens:\n```csharp\nvar userId = StreamChatClient.SanitizeUserId(\"user-name\");\nvar userToken = StreamChatClient.CreateDeveloperAuthToken(userId);\n\n// Replace API_KEY with your Api Key from the Stream Dashboard\nvar localUserData = await Client.ConnectUserAsync(\"API_KEY\", userId, userToken);\n```\n\n### Async or Callback\nEvery function that waits for response from the server you can either call using the C# modern async/await syntax or append the `.AsCallback()` and use as classical callbacks as follows:\n```csharp\nClient.ConnectUserAsync(\"API_KEY\", userId, userToken)\n    .AsCallback(onSuccess: result =\u003e\n    {\n        var localUserData = result;\n    }, onFailure: exception =\u003e\n    {\n        Debug.LogException(exception);\n    });\n```\nThe `.AsCallback()` method accepts two delegates: `Action\u003cTResponse\u003e onSuccess` and the `Action\u003cException\u003e onFailure` that you can use to react to both successfull and error response case.\nInstead lambda callbacks you can also provide methods with the same signature as in the example below:\n```csharp\npublic void ConnectUser()\n{\n    var userId = StreamChatClient.SanitizeUserId(\"user-name\");\n    var userToken = StreamChatClient.CreateDeveloperAuthToken(userId);\n\n    Client.ConnectUserAsync(\"API_KEY\", userId, userToken)\n        .AsCallback(OnUserConnected, OnUserConnectionFailed);\n}\n\nprivate void OnUserConnected(IStreamLocalUserData localUserData)\n{\n    Debug.Log(\"User connected: \" + localUserData.User.Name);\n}\n\nprivate void OnUserConnectionFailed(Exception exception)\n{\n    Debug.LogException(exception);\n}\n```\nWe strongly advice using the `async/await` syntax which, as you'll notice in the following examples, makes the code much simpler and easier to read and maintain.\n\n### Create a channel\nOnce you're connected you can start using channels so that users can send messages.\n\nThere are 2 ways to create channels:\n#### 1. By ID\nFor predefined channels to which users can join. This is great for any general purpose channels or clans, clubs, groups which users can join or leave.\n```csharp\nvar channel = await Client.GetOrCreateChannelWithIdAsync(ChannelType.Messaging, \"my-channel-id\");\n```\nor with a callback:\n```csharp\nClient.GetOrCreateChannelWithIdAsync(ChannelType.Messaging, \"my-channel-id\")\n    .AsCallback(channel =\u003e\n    {\n        Debug.Log($\"Channel {channel.Id} created successfully\");\n    }, exception =\u003e\n    {\n        Debug.LogException(exception);\n    });\n```\n#### 2. For a group of users\nGreat for public or private group messages, the order of users in group doesn't matter so whenever the users are connected using this method they will always see their chat history:\n```csharp\nvar channel = await Client.GetOrCreateChannelWithMembersAsync(ChannelType.Messaging, users);\n```\n### Query Channels\nTo browse all channels or channels filtered by some criteria use `Client.QueryChannelsAsync`\n#### Query channels to which local user belongs as a member\n```csharp\nvar filters = new IFieldFilterRule[]\n{\n   ChannelFilter.Cid.In(\"channel-cid\", \"channel-2-cid\", \"channel-3-cid\")\n};\nvar sort = ChannelSort.OrderByAscending(ChannelSortFieldName.CreatedAt);\n\nvar channels = await Client.QueryChannelsAsync(filters, sort);\n```\nThe filtering mechanism is very powerful and allows you to combine multiple rules. You can check the full list of available fields and operators that you can use for channel querying [here](https://getstream.io/chat/docs/unity/query_channels/?language=unity#channel-queryable-built-in-fields).\n\n### Channel Filters Examples:\n#### Filter for channels with Cid\n```csharp\n// Each operator usually supports multiple argument types to match your needs\nChannelFilter.Cid.EqualsTo(\"channel-cid\"); // string\nChannelFilter.Cid.EqualsTo(channel); // IStreamChannel\nChannelFilter.Cid.In(\"channel-cid\", \"channel-2-cid\", \"channel-3-cid\"); // Comma separated strings\n\nvar channelCids = new List\u003cstring\u003e { \"channel-1-cid\", \"channel-2-cid\" };\nChannelFilter.Cid.In(channelCids); // Any collection of string\n```\n#### Filter for channels created by the local user\n```csharp\nvar filters = new IFieldFilterRule[]\n{\n    ChannelFilter.CreatedById.EqualsTo(Client.LocalUserData.User)\n};\n```\n#### Filter for channels with more than 10 members\n```csharp\nvar filters = new IFieldFilterRule[]\n{\n    ChannelFilter.MembersCount.GreaterThan(10)\n};\n```\n#### Filter for channels created last week\n```csharp\nvar weekAgo = DateTime.Now.AddDays(-7).Date;\nvar filters = new IFieldFilterRule[]\n{\n    ChannelFilter.CreatedAt.GreaterThan(weekAgo)\n};\n```\n#### Filter for channels updated within last 24 hours\n```csharp\nvar dayAgo = DateTime.Now.AddHours(-24);\nvar filters = new IFieldFilterRule[]\n{\n    ChannelFilter.UpdatedAt.GreaterThan(dayAgo)\n};\n```\n\n### Get messages\nMessages are accessible via `channel.Messages` property that contains collection of the most recent messages. Because there can potentialy be thousands of messages in a channel history the `channel.Messages` collection contains only the latest messages. You can load older messages by calling the `channel.LoadOlderMessagesAsync()` which will load additional portion of the history. A common approach is to call `channel.LoadOlderMessagesAsync()` whenever users hits the end of your messages scroll view, this way you only load older messages when the user actually wants to view them. You can see an example of this approach in Sample Project's [MessageListView.cs](https://github.com/GetStream/stream-chat-unity/blob/develop/Assets/Plugins/StreamChat/SampleProject/Scripts/Views/MessageListView.cs#L34)\n\n### Send message\n```csharp\nvar sentMessage = await channel.SendNewMessageAsync(\"Hello\");\n```\n### Send message to a thread\n```csharp\nvar messageInThread = await channel.SendNewMessageAsync(new StreamSendMessageRequest\n{\n    ParentId = parentMessage.Id, // Write in thread\n    ShowInChannel = false, // Optionally send to both thread and the main channel like in Slack\n    Text = \"Hello\",\n});\n```\n### Quote a message\n```csharp\nvar messageWithQuote = await channel.SendNewMessageAsync(new StreamSendMessageRequest\n{\n    QuotedMessage = quotedMessage, // Reference to IStreamMessage \n    Text = \"Hello\",\n});\n```\n### Silent message\nSilent messages do not trigger events for channel members. Often used for system messages\n```csharp\nvar silentMessage = await channel.SendNewMessageAsync(new StreamSendMessageRequest\n{\n    Text = \"System message\",\n    Silent = true\n});\n```\n### Pin message\n#### Pin indefinitely\n```csharp\nawait message.PinAsync();\n```\n#### Pin for a specified period of time\n```csharp\nawait message.PinAsync(new DateTime().AddDays(7)); // Pin for 7 days\n```\n### Unpin a message\n```csharp\nawait message.UnpinAsync();\n```\n### Update message\n```csharp\nawait message.UpdateAsync(new StreamUpdateMessageRequest\n{\n    Text = \"New changed message\",\n});\n```\n### Attach custom data to a message\n```csharp\nawait message.UpdateAsync(new StreamUpdateMessageRequest\n{\n    CustomData = new StreamCustomDataRequest\n    {\n        {\"CategoryId\", 12},\n        {\"Awards\", new string[]{\"Funny\", \"Inspirational\"}}\n    }\n});\n```\n### Delete a message\n#### Soft Delete\nOnly clears the text but leaves other related data, reactions, thread sub-messages, etc. intact\n```csharp\nawait message.SoftDeleteAsync();\n```\n#### Hard Delete\nRemoves a message completely and removes all data related to this message\n```csharp\nawait messageInChannel.HardDeleteAsync();\n```\n### Add reactions to messages\n#### Simple reaction\n```csharp\nawait message.SendReactionAsync(\"like\");\n```\n#### Reaction with custom score\n```csharp\nawait message.SendReactionAsync(\"clap\", 10);\n```\n#### Add reaction and remove any previous reactions from this user for this message\n```csharp\nawait message.SendReactionAsync(\"love\", enforceUnique: true);\n```\n### Delete reaction:\n```csharp\nawait message.DeleteReactionAsync(\"like\");\n```\n### Upload a file\n```csharp\n// Get file byte array however you want e.g. Addressables.LoadAsset, Resources.Load, etc.\nvar sampleFile = File.ReadAllBytes(\"path/to/file\");\nvar fileUploadResponse = await channel.UploadFileAsync(sampleFile, \"my-file-name\");\nvar fileWebUrl = fileUploadResponse.FileUrl;\n```\n### Upload an image\n```csharp\nvar sampleImage = File.ReadAllBytes(\"path/to/file\");\nvar imageUploadResponse = await channel.UploadImageAsync(sampleFile, \"my-image-name\");\nvar imageWebUrl = imageUploadResponse.FileUrl;\n```\n### Delete file or image\n```csharp\nvar channel = await Client.GetOrCreateChannelWithIdAsync(ChannelType.Messaging, channelId: \"my-channel-id\");\nawait channel.DeleteFileOrImageAsync(\"file-url\");\n```\n### React to Channel changes\nChannel objects are being automatically updated whenever any change occur (new messages, reactions, etc.). You can react to these changes by subscribing to `IStreamChannel` exposed events:\n```csharp\nchannel.MessageReceived += OnMessageReceived;\nchannel.MessageUpdated += OnMessageUpdated;\nchannel.MessageDeleted += OnMessageDeleted;\nchannel.ReactionAdded += OnReactionAdded;\nchannel.ReactionUpdated += OnReactionUpdated;\nchannel.ReactionRemoved += OnReactionRemoved;\n```\n### Get local user or local user data\n```csharp\nvar localUserData = Client.LocalUserData;\nvar localUser = localUserData.User;\n```\n* Local User Data - Additional data related to the user connected on the local device like: muted channels, list of devices, unread channels, unread messages, etc.\n* Local User - instance of `StreamUser` representing the user on the local device\n### Get all users\n```csharp\nvar users = await Client.QueryUsersAsync();\n```\n### Find user by ID\n```csharp\nvar users = await Client.QueryUsersAsync(new Dictionary\u003cstring, object\u003e()\n{\n    {\n        \"id\", new Dictionary\u003cstring, object\u003e\n        {\n            { \"$eq\", otherUserId }\n        }\n    }\n});\nvar otherUser = users.First();\n```\n### Find multiple users by ID\n```csharp\nvar filters = new Dictionary\u003cstring, object\u003e\n{\n    {\n        \"id\", new Dictionary\u003cstring, object\u003e\n        {\n            {\n                \"$in\", listOfUserIds\n            }\n        }\n    }\n};\n\nvar users = await Client.QueryUsersAsync(filters);\n```\nRead more on supported [query parameters and operators](https://getstream.io/chat/docs/unity/query_users/?language=unity#suported-queries)\n\n### Add Channel Members\nDepending on your app configuration users may need to join channels as members in order to send messages or see other users messages\n```csharp\n// Multiple overloads available depending on your needs\nawait channel.AddMembersAsync(user); // instance of IStreamUser\nawait channel.AddMembersAsync(user1, user1); // Multiple instances of IStreamUser\nawait channel.AddMembersAsync(listOfUsers); // List\u003cIStreamUser\u003e\nawait channel.AddMembersAsync(\"user-id\"); // string ID\nawait channel.AddMembersAsync(listOfUserIds); // List\u003cstring\u003e that contains IDs\n```\n#### Remove Channel Members\n```csharp\n// Multiple overloads available depending on your needs\nawait channel.RemoveMembersAsync(member); // instance of IStreamChannelMember\nawait channel.RemoveMembersAsync(member1, member2); // Multiple instances of IStreamChannelMember\nawait channel.RemoveMembersAsync(listOfMembers); // List\u003cIStreamChannelMember\u003e\nawait channel.RemoveMembersAsync(user); // instance of IStreamUser\nawait channel.RemoveMembersAsync(user1, user1); // Multiple instances of IStreamUser\nawait channel.RemoveMembersAsync(listOfUsers); // List\u003cIStreamUser\u003e\nawait channel.RemoveMembersAsync(\"user-id\"); // string ID\nawait channel.RemoveMembersAsync(listOfUserIds); // List\u003cstring\u003e that contains IDs\n```\n### Moderation\nStream provides all the necessary tools and features to properly manage a large community.\n### Flagging\nFlagging means that this user or message will be reported to the chat moderation. Chat admins and moderators can view reported users and messages in the Dashboard.\n#### Flag a user\n```csharp\nawait user.FlagAsync();\n```\n#### Flag a message\n```csharp\nawait message.FlagAsync();\n```\n### Ban a user\n#### Ban indefinitely\n```csharp\nawait channel.BanUserAsync(user);\n```\n#### Ban for a specified period of time\n```csharp\nawait channel.BanUserAsync(user, \"You got banned for 2 hours for toxic behaviour.\", 120);\n```\n#### Ban user IP\nBanning IP helps to prevent case where user creates a new account to bypass the ban.\n```csharp\nawait channel.BanUserAsync(user, timeoutMinutes: 120, isIpBan: true);\n```\n#### Ban for a specified period of time\n```csharp\nawait channel.BanUserAsync(user, \"You got banned for 2 hours for toxic behaviour.\", 120);\n```\n### Query Banned Users\n```csharp\nvar request = new StreamQueryBannedUsersRequest\n{\n    CreatedAtAfterOrEqual = new DateTimeOffset().AddHours(-24),\n    Limit = 30,\n    Offset = 0,\n};\n\nvar bannedUsersInfo = await Client.QueryBannedUsersAsync(request);\n```\n### Shadow Banning\nShadow banned user doesn't know he's being banned. This is sometimes helpful because it takes additional time for a user to realize the he's banned.\n#### Shadow ban `StreamUser`\n```csharp\nawait channel.ShadowBanUserAsync(user);\n```\n#### Shadow ban `StreamChannelMember`\n```csharp\nawait channel.ShadowBanMemberAsync(channelMember);\n```\n### Mute a user\n```csharp\nawait user.MuteAsync();\n```\n### Unmute a user\n```csharp\nawait user.UnmuteAsync();\n```\n### Mute a channel\n```csharp\nawait channel.MuteChannelAsync();\n```\n### Unmute a channel\n```csharp\nawait channel.UnmuteChannelAsync();\n```\n### Check our documentation for more examples\nThe above examples are only a few out of many - check out our [Full Documentation](https://getstream.io/chat/docs/unity/?language=unity) for more insight and examples\n\n---\n\n## Missing any features?\nGo ahead and open [GitHub](https://github.com/GetStream/stream-chat-unity/issues/new) Issue with your request and we'll respond as soon as possible.\n\n---\n\n## Any issues, bugs, or questions?\nReach out to our [Support](https://getstream.io/contact/support/).\n\n---\n\n## We are hiring\n\nWe've recently closed a [\\$38 million Series B funding round](https://techcrunch.com/2021/03/04/stream-raises-38m-as-its-chat-and-activity-feed-apis-power-communications-for-1b-users/) and we keep actively growing.\nOur APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.\nCheck out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetstream%2Fstream-chat-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetstream%2Fstream-chat-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetstream%2Fstream-chat-unity/lists"}