mirror of
https://github.com/SrIzan10/automata.git
synced 2026-05-01 10:35:22 +00:00
feat: pull requests can make comments now!
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ fun Routing.pullRequests() {
|
||||
call.respond(HttpStatusCode.Unauthorized, "Nice try")
|
||||
}
|
||||
launch(Dispatchers.Default) {
|
||||
|
||||
Client.eventEmitter.produceEvent(text)
|
||||
}.join()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user