Bans

Advanced and powerful global ban list API

Check if a user is banned

ksoft.bans.check(user);
ksoft.bans.check(users); // Array<user>
Usage
Example
Usage

Parameter

Type

user

String (Snowflake) or Array<Snowflake>

Success: Boolean (if only one user)

Success: Array<Snowflake> (if array, only of banned users)

Example
ksoft.bans.check('102102717165506560');
ksoft.bans.check(['102102717165506560', '356826975815598080']);

‚Äč

Get information about a ban

ksoft.bans.info(user);
ksoft.bans.info(users); // Array<user>
Usage
Example
Usage

Parameter

Type

user

String (Snowflake) or Array<Snowflake>

Success: Ban (if one user)

Success: Array<Ban> (if multiple users, only of banned users)

Not Found: null (if one user)

Example
ksoft.bans.info('102102717165506560');
ksoft.bans.info(['102102717165506560', '356826975815598080']);

Report a user

ksoft.bans.add(ban);
Usage
Example
Usage

Parameter

Type

ban

Ban

Success: BanAPIResponse

Example
const ban = new Ban()
.setUser('432129282710700033', 'Aero', '5703')
// setUser also works by just passing a d.js user object
.setModerator('102102717165506560')
.setReason('Being the first bot to properly implement ksoft.js', 'https://git.aero.bot/aero/commit/a91c44b0');
ksoft.bans.add(ban);