Skip to content

Client Options

Written by

Client Options

1
const { AoiClient } = require("aoi.js");
2
3
const client = new AoiClient({
4
token: string,
5
prefix: string,
6
intents: ["MessageContent", "Guilds", "GuildMessages"],
7
events: ["onMessage", "onJoin", "onLeave"],
8
disableFunctions?: ["$function", "$function"],
9
mobilePlatform?: boolean,
10
respondToBots?: boolean,
11
guildOnly?: boolean,
12
cache?: {
13
users: number,
14
messages: number,
15
},
16
disableAoiDB?: boolean,
17
database?: {
18
type: "aoi.db",
19
db: require("@aoijs/aoi.db"),
20
tables: ["main"],
21
path: "./database/",
22
securityKey: string,
23
}, // Example refers to @aoijs/aoi.db, other databases are not included in this Example.
24
suppressAllErrors?: boolean,
25
errorMessage?: string,
26
aoiAutoUpdate?: boolean,
27
aoiWarning?: boolean,
28
aoiLogs?: boolean,
29
respondOnEdit?: {
30
commands: boolean,
31
time: number,
32
nonPrefixed?: boolean,
33
},
34
});

OPTIONINPUTEXPLANATION
tokenstringYour Discord Bot Token
prefixstring | arrayYour Discord Bot Prefix
intentsarrayRequired Intents
eventsarrayRequired Events
disableFunctionsarrayaoi.js functions you want to make unusable
mobilePlatformbooleanDisplay your Discord Bot Status as “mobile”
respondToBotsbooleanEither give your bot the ability to respond to bots or remove it.
guildOnlybooleanEither give your bot the ability to respond in Direct Message or remove it.
cachestringClient Cache Options.
disableAoiDBbooleanDisables the use of aoi.db within your bot, to add custom databases and such.
databasestringClient Database Options. (aoi.db)
suppressAllErrorsbooleanSuppress all occurring errors.
errorMessagestringSend a given error message when suppressAllErrors executes, supports parser and functions.
aoiAutoUpdatebooleanAutomatically update aoi.js if a update is available.
aoiWarningbooleanDisable aoiWarning logs which are sent to your console.
aoiLogsbooleanDisable aoiLogs which are sent to your console.
respondOnEditstringGive your bot the ability to respond to edited messages and execute the given commands.