Skip to content
This repository has been archived by the owner on Sep 25, 2024. It is now read-only.

Latest commit

 

History

History
183 lines (144 loc) · 6.51 KB

DOCS.md

File metadata and controls

183 lines (144 loc) · 6.51 KB

🛠️ Built-in Functions:

  • Translate
  • convertTime
  • enable/disable process.stderr.clearLine
  • getExtFromMimeType
  • getTime
  • jsonStringifyColor
  • randomString/Number
  • findUid Facebook
  • getStreamsFromAttachment
  • getStreamFromURL
  • Google Drive: (upload, delete, getFile, etc...)
  • And more...
    See utils.js for more details.

🧠 Prepare

⚠️ Important Note

  • Any issues related to 18+, vulgarity, obscenity, pornography, treason, politics, etc., are not allowed in GoatBot. Adding custom commands or modifying the code to violate these rules will result in a permanent ban. Please be cautious with each line of your code.

💾 Database

Type: You can choose one of the following storage methods, config at config.json

Users see more details at usersData.js

// CREATE USER DATA
const newUserData = await usersData.create(userID, userInfo);
// userInfo is data get by (await api.getUserInfo(userID))[userID] method or undefined is auto

// GET USER DATA
const userData = await usersData.get(userID);
// SET USER DATA
await userData.set(userID, updateData, path);


// Example 1
//   set data with path
await usersData.set(4, { banned: true }, "data");

//   set data without path
const userData = await usersData.get(userID);
userData.data = {
	banned: true
};
await usersData.set(4, {
	data: userData.data
});

// Example 2
// set data with path
await usersData.set(4, {
	name: "ABC",
	birthday: "01/01/1999"
}, "data.relationship.lover");

// set data without path
const userData = await usersData.get(userID);
userData.data.relationship.lover = {
	name: "ABC",
	birthday: "01/01/1999"
};
await usersData.set(4, {
	data: userData.data
});
// GET ALL USER DATA
const allUsers = await usersData.getAll();

// GET USER NAME
const userName = await usersData.getName(userID);

// GET USER AVATAR URL
const avatarUrl = await usersData.getAvatarUrl(userID);

// REFRESH INFO USER
await usersData.refreshInfo(userID, updateData);
// updateData is data get by api.getUserInfo(userID)[userID] method or undefined is auto 
// refresh data gender, name, vanity of the user 

// REMOVE USER DATA
await usersData.remove(4);
Threads see more details at threadsData.js

// CREATE THREAD DATA
const newThreadData = await threadsData.create(threadID, threadInfo);
// threadInfo is data get by api.getThreadInfo() method or undefined is auto

// GET THREAD DATA
const threadData = await threadsData.get(threadID);

// GET ALL THREAD DATA
const allThreads = await threadsData.getAll();

// GET THREAD NAME
const threadData = await threadsData.get(threadID);
const threadName = threadData.threadName;
// SET THREAD DATA
await threadsData.set(threadID, updateData, path);


// Example 1
// set data with path
await threadsData.set(2000000000000000, "Helo", "data.welcomeMessage");

// set data without path
const threadData = await threadsData.get(2000000000000000);
threadData.data.welcomeMessage = "Hello";
await threadData.set(2000000000000000, {
	data: threadData.data
});
// REFRESH THREAD DATA
await threadsData.refreshInfo(threadID, threadInfo);
// threadInfo is data get by api.getThreadInfo(threadID) method or undefined is auto 
// refresh data threadName, threadThemeID, emoji, adminIDs, imageSrc and members of thread

📦 Create new command

Vietnamese

English

Start create new command

  • Reference from available commands: cmds and events

  • See example at for command here, for event here

  • Or if using vscode you can create new command with snippets GoatBotCommandCreate or GoatBotEventCreate (press tab to jump to next placeholder)

🚀 Updating...