feat: pull requests can make comments now!

This commit is contained in:
Jacob Nguyen
2022-08-18 14:51:16 -05:00
parent 266a00251d
commit 7bae5eb6f6
3 changed files with 1 additions and 4 deletions

View File

@@ -8,7 +8,6 @@ class EventEmitter {
val events = _events.asSharedFlow() // publicly exposed as read-only shared flow
suspend fun produceEvent(event: String) {
print(event)
_events.emit(event) // suspends until all subscribers receive it
}
}

View File

@@ -28,7 +28,6 @@ fun Routing.pullRequests() {
call.respond(HttpStatusCode.Unauthorized, "Nice try")
}
launch(Dispatchers.Default) {
Client.eventEmitter.produceEvent(text)
}.join()
}

View File

@@ -8,8 +8,7 @@ fun main() = runBlocking {
val repo = client.fetchRepoAsync("awesome-plugins").await()
client.on<PullRequests>("pull_request") {
println(it)
repo.getPullRequest(it.number).comment("Hello, I just saw that you did something to this pull request")
}
println("Start program")
client.startWebhookListener()