im not skilled with discord.js (i dont know it), but from my research, you would do asn.ban(); (this is probably only for one user, so i guess you would find a way to get one user at a time and ban them).
The “forEach is not a function” error occurs when we call the forEach() method on a value that is not of type array, Map , or Set . To solve the error, make sure to only call the forEach method on arrays, Map or Set objects.
i guess you aren’t declaring an array. maybe first get the database info and then put it in an array. and then do the bans? see here if you don’t know how to make arrays.