FabricMC / kotlin-fabric-discord-bot

The discord bot previously used in the fabric discord server.
MIT License
5 stars 7 forks source link

Add !github lockall command #4

Closed Scotsguy closed 4 years ago

Scotsguy commented 4 years ago

Locks all of a user's issues (and PRs, because those are actually just issues with a flag) on a specific repository with the given reason. If it errors halfway through it stops and returns what it did successfully lock. I don't have an org I can lock people on for testing so I can't guarantee the api parts work (I tested by stubbing out the function). But hey, it compiles!

Didn't end up refactoring the command system, so some parts are not so nice.

One small part of #3

sfPlayer1 commented 4 years ago

I don't think filtering the reason is appropriate unless GH limits it?

liach commented 4 years ago

For player's point, I guess the bot can have a default reason like spam when no explicit reason is offered?

Scotsguy commented 4 years ago

GitHub doesn't allow reasons that aren't one of those four: https://docs.github.com/en/rest/reference/issues#lock-an-issue I'll make spam a default reason when none is given, I guess