Also, your bot will likely to be detected as spam bot as it sends dms to kicked ones.
Here is simple bot build with Discord.js v13 and Node, that will list or bans users that didn't send anything in channel that the command is used. Good for keeping active users and kicking the idling ones.
What exacly it does?
- Makes a list of messages in channel
- Gets all user ids of messages
Then, for that list:
- Checks if user is on whitelist, if not continue
- Checks if user is a bot, if not continue
- Sends a message with an invite to rejoin. (one-time use, infinite lifespan, every invite is uniqe)
- Kicks form server.
BE SURE TO FOLLOW THE WIKI TUTORIAL
Best to fork it on Repl.it
Templates taken from and inspired by Discord.js