Skip to content

How do you disconnect your bot after some time of inactivity? #1886

Discussion options

You must be logged in to vote

I don't think there is direct support for this, but it is possible if you know how to multithread. Whenever someone uses a bot command, you can set an AtomicLong to the timestamp it was last used at, and then have another thread that checks if its been a while since a command was used every so often (You can use a ScheuledExectuorService to make it easier to check).

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Miha23833
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants