✨️ Information
-
What is mocaoi.js: mocaoi.js module is a module made for aoi.js. This module contains custom functions that are not available in aoi.js. And it offers you more useful functions.
-
Warning: only supports aoi.js version: v6+
-
Explanation for those who do not know aoi.js:
-
aoi.js is a JavaScript library that is designed to make it easy to build Discord bots.
-
It is open-source and free to use, and provides a simple, easy-to-use interface for interacting with the Discord API and handling events.
-
aoi.js is suitable for beginners who are new to building bots, as well as experienced developers who want to save time and streamline their workflow.
-
Extras;
- If you want to download the mocaoi database module Click.
📒 Setup
- To get started with mocaoi.js, follow these steps:
- index.js
const { AoiClient } = require("aoi.js");
const client = new AoiClient({
token: "Discord Bot Token",
prefix: "Discord Bot Prefix",
intents: ["MessageContent", "Guilds", "GuildMessages"],
events: ["onMessage", "onInteractionCreate"],
database: {
type: "aoi.db",
db: require("@akarui/aoi.db"),
tables: ["main"],
path: "./database/",
extraOptions: {
dbType: "KeyValue",
},
},
});
// mocaoi.js setup
const { Plugin } = require("mocaoi.js");
const maoi = new Plugin({
executeOnLog: true, // executeOnLog, mocaoi.js log is sent to the console when your project is started.
loadFunctions: true, // loadFunctions is required for the functions to work.
autoUpdate: true, // autoUpdate automatically updates if a new update is available.
client: client // We define our client object.
});
- If you come to our Discord support server, you can get more detailed information about function usage!
Show Function's List
Functions | Params | Required Params ( true / false ) |
---|---|---|
$mocaoiVersion | [] | [] |
$clientInfo | [info] | [true] |
$sendColoredLog | [text;hex?] | [true, false] |
$commandExists | [name;type?] | [true, false] |
$translate | [from;to;text] | [true, true, true] |
$aoiVersion | [] | [] |
$spotifySearch | [song_name] | [true] |
$isCaps | [percentage%;text] | [true, true] |
$chatAI | [text] | [true] |
$urlCheck | [text] | [true] |
$textToImage | [text] | [true] |
$recreateChannel | [] | [] |
$c ( comment ) | [text] | [true] |
$createTranscript | [channelId?;logChannelId?] | [false, false] |
$join | [separator;...text] | [true, true] |
$reverseText | [text] | [true] |
$fetchGuilds | [separator?;id/name] | [false, false] |
$ceil | [number] | [true] |
$createTable | [tableTitle;...headings;...rows] | [true, true, true] |
$absolute | [number] | [true] |
$floor | [number] | [true] |
$loopLog | [repeatCount;sleepMs;text] | [true, true, true] |
$toRoman | [number] | [true] |
$createGame | [gameType;{json}] | [true, true] |
$advLog | [{json}] | [true] |
$mkdir | [path] | [true] |
$removeFonts | [text] | [true] |
$toChunks | [text, number] | [true, true] |
$createProgressBar | [min, max, elapsedChar, progressChar, emptyChar, barLength] | [true, true, true, true, true, true] |
$toAbbreviation | [text] | [true] |
-
$clientInfo Parameters
- ispublic
- isverified
- memory
- rss
- platform
- arch
Show Game Functions
- Creating game
$createGame[GAME_TYPE;{JSON}]
rps
GAME_TYPE: $createGame[rps;{
"gamedata": {
"buttons": {
"rock": "🪨",
"scissors": "✂️",
"paper": "📃"
},
"result": {
"win": "Congratulations! You won the game by choosing {your_choice}. (My choice was {bot_choice}.)",
"lose": "You lost. I chose {bot_choice}.",
"draw": "It's a draw. I also chose {bot_choice}."
},
"embeddata": {
"color": "Yellow",
"title": "Rock Paper Scissors",
"description": "click!"
}
}
}]
- creating command;
module.exports = {
name: "rps",
aliases: ["rockpaperscissors"],
code: `
$createGame[rps;{
"gamedata": {
"buttons": {
"rock": "🪨",
"scissors": "✂️",
"paper": "📃"
},
"result": {
"win": "Congratulations! You won the game by choosing {your_choice}. (My choice was {bot_choice}.)",
"lose": "You lost. I chose {bot_choice}.",
"draw": "It's a draw. I also chose {bot_choice}."
},
"embeddata": {
"color": "Yellow",
"title": "Rock Paper Scissors",
"description": "click!"
}
}
}]
`
}
Show Update Logs
v1.3.1
- Added
$createProgressBar
function - Added
$toAbbreviation
function
v1.3.0
- Added
$mkdir
function - Added
$removeFonts
function - Added
$toChunks
function
v1.2.8
- Fixed
$advLog
function
v1.2.7
- Added
$advLog
function
v1.2.6
- Fixed version
v1.2.5
- Added
$createGame
function
v1.2.1
- Added
$loopLog
function - Added
$toRoman
function
v1.2.0
- Added
$createTable
function - Added
$absolute
function - Added
$floor
function
v1.1.5
- Added
$join
function - Added
$reverseText
function - Added
$fetchGuilds
function - Added
$ceil
function
v1.1.4
- Updated
$recreateChannel
function- New Params: [chanelID , returnID?]
- Added
$createTranscript
function
v1.1.3
- Added
$recreateChannel
function - Added
$c
function
v1.1.2
- Some changes
v1.1.1
- Added
$textToImage
function
v1.0.11
- Added
$chatAI
function - Added
$isCaps
function
NPM | GitHub | Support Server | mocaoi.db