Ban Management

Ban Management

193k Downloads

How to correctly specify the time of the temporary mute or ban in the code?

Opened this issue ยท 1 comments

commented

Hello. I am trying to write a small add-on for BanManager to issue punishments via Discord. I figured out about permanent mutes and bans, but did not figure out how to correctly indicate the time for temporary punishments? For example, how do i can convert "3h" to a format suitable for BmAPI#mute?

commented

The API expects a unix timestamp (in seconds) of when the punishment should expire. I'll add a method to BmAPI to convert from a string into a long, but in the mean time you can use DateUtils.parseDateDiff("3h", true);