Skip to content

Instantly share code, notes, and snippets.

@jetaggart
Created June 29, 2020 18:45
Show Gist options
  • Save jetaggart/9246f417c477004eb63a5eed702e33fd to your computer and use it in GitHub Desktop.
Save jetaggart/9246f417c477004eb63a5eed702e33fd to your computer and use it in GitHub Desktop.
// android/app/src/main/java/io/getstream/thestream/services/ChatService.kt:48
fun createGroupChannel(channelName: String) {
val channelId = channelName
.toLowerCase(Locale.getDefault())
.replace("\\s".toRegex(), "-")
val result = client
.createChannel(
ModelType.channel_livestream,
channelId,
mapOf(
"name" to channelName,
"image" to "https://robohash.org/${channelId}.png"
)
)
.execute()
if (result.isError) {
throw result.error()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment