k
k
ksoft.js
Search…
Bans
Advanced and powerful global ban list API

Check if a user is banned

1
ksoft.bans.check(user);
2
ksoft.bans.check(users); // Array<user>
Copied!
Usage
Example
Parameter
Type
user
String (Snowflake) or Array<Snowflake>
Success: Boolean (if only one user)
Success: Array<Snowflake> (if array, only of banned users)
1
ksoft.bans.check('102102717165506560');
2
ksoft.bans.check(['102102717165506560', '356826975815598080']);
Copied!

Get information about a ban

1
ksoft.bans.info(user);
2
ksoft.bans.info(users); // Array<user>
Copied!
Usage
Example
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)
1
ksoft.bans.info('102102717165506560');
2
ksoft.bans.info(['102102717165506560', '356826975815598080']);
Copied!

Report a user

1
ksoft.bans.add(ban);
Copied!
Usage
Example
Parameter
Type
ban
Ban
Success: BanAPIResponse
1
const ban = new Ban()
2
.setUser('432129282710700033', 'Aero', '5703')
3
// setUser also works by just passing a d.js user object
4
.setModerator('102102717165506560')
5
.setReason('Being the first bot to properly implement ksoft.js', 'https://git.aero.bot/aero/commit/a91c44b0');
6
7
ksoft.bans.add(ban);
Copied!
Last modified 1yr ago