aoijs / aoi.js Goto Github PK
View Code? Open in Web Editor NEWaoi.js - The most advanced string-based package to create a Discord Bot fast and powerful.
Home Page: https://aoi.js.org
License: Apache License 2.0
aoi.js - The most advanced string-based package to create a Discord Bot fast and powerful.
Home Page: https://aoi.js.org
License: Apache License 2.0
Create a guild like 'client.guild.create' in djs
$createGuild[name;returns invite (yes/no)]
also
$setGuildOwner[user id] transfer the ownership of the server to a user if the guild owner was the bot
$messageCollector
$messageCollector
is as same as $reactionCollector
but it collects every messages in a given channel within a given time. It collects almost Every data in the channel after the collection is started and will store the collection. It collects like usernames, messages, etc.,
It already exists in Discord.JS but idk how to make it, This is the Collector docs.
Code used:
$lavalinkExecute[songinfo;duration_left] + $lavalinkExecute[current_duration]
More:
this will let {error}
be handled in an awaited command for error handling
Code used:
$if[$memberExists[$get[user]]==true;]
$title[$userTag[$get[user]]]
$description[Here is some information about $username[$get[user]]]
$addField[:calendar: Account Creation;$creationDate[$get[user];date];yes]
$addField[:calendar: Joined $serverName;$memberJoinedDate[$get[user];date];yes]
$color[RANDOM]
$thumbnail[$replaceText[$userAvatar[$get[user]];.webp;.png]]
$elseIf[$memberExists[$get[user]]==false;]
$title[$userTag[$get[user]]]
$description[Here is some information about $username[$get[user]]]
$addField[:calendar: Account Creation;$creationDate[$get[user];date];yes]
$addField[:id: User ID;$get[user];yes]
$addField[:pencil2: Display Name;$username[$get[user]];yes]
$color[RANDOM]
$thumbnail[$replaceText[$userAvatar[$get[user]];.webp;.png]]
$endelseIf
$endIf
$onlyIf[$userExists[$get[user]]==true;Cannot find user]
$let[user;$findUser[$message[1]]]
Code used:
bot.botJoinCommand({
channel: "838023671280435245",
code: `
$title[i have been added in $serverName]
$description[
Server User Count | $membersCount
Owner | $userTag[$ownerID]]
$footer[i am in $serverCount Guilds!]
$color[BLUE]`
});
bot.onGuildJoin()
bot.botLeaveCommand({
channel: "838023671280435245",
code: `
$title[i have been kicked in $serverName]
$description[
Server User Count | $membersCount
Owner | $userTag[$ownerID]]
$footer[i am in $serverCount Guilds!]
$color[RED]`
});
More:
Hey there! It would be easier to implement lavalink in the regular music commands ($play). Let me explain how it works. If there is a lavalink stream using bot.createLavalink(), the bot would automatically use lavalink instead of ffmpeg.
gets varible values by leaderboard position
Usage:
$getLeaderboardValue[variable name;variable type (user/globalUser/server);asc/desc;position;{servername} - {value} - {server id}]
Functions: $setservervar | $hetservervar
Code used:
module.exports = ({
name: "setup-logs",
aliases: ['setlogs','setuplogs','set-logs'],
code: `
$channelsendmessage[$channelid;Everything is setup!]
$wait[5s]
$channelsendmessage[$getservervar[modlogs;$guildID];{title:TEST LOG!}{description:Test Successful!
Logs are all set up!}]
$wait[5s]
$channelsendmessage[$channelid;Testing logs...]
$setServerVar[modlogs;$channelID[spectrum-logs];$guildID]
$wait[5s]
$channelsendmessage[$channelid;Finalizing...]
$createChannel[spectrum-logs;text;no]
$wait[5s]
$channelsendmessage[$channelid;Setting up...]
`
})
Info:
For my mod-logs command I use $set/$get servervar to save the channelID for the logs. However. When I used the command in 2 different servers the second server sent the logs to the first server. Meaning it's saving the vars globally to 1 server.
Aoi.js version: 1.0.6
Node.js version: 12.x
Operating system: Chrome
Screenshots (If any): N/A
You guys should post releases 😃
The use of the command is prohibited on channels whose ID is entered. If used, the entered error message is sent.
bot.command({
name:"hello",
code:`helloooo!
$ignoreChannels[798055313907253279;I was banned from saying hello to you on this channel :(]`
})
There is an example in bdfd.
$djsEval
$djsEval[ async (d) => {
d.client.users.cache.get(message.author.id)
};yes]
async (d) => {
d.client.users.cache.get(message.author.id)
}
More:
Add a field called "channelID" in these commands so we can make the bot to await replies or reactions in an another channel
Code used:
module.exports = [{
name: "help",
aliases: 'h',
code: `
$if[$getServerVar[New]==yes]
$setUserVar[mid;$get[id]]
$reactionCollector[$get[id];$authorID;5m;🎯;hsetup;no]
$let[id;$sendMessage[{title:**Thanks for adding our bot ❤️**}{description:\`We are very much greatful that you decided to add our bot!\`
To make the best out of our bot please react with 🎯 or use the command \`.setup\`
**NOTE**: You can skip this setup, but its recommended you follow thru to have the best possible experience with our bot!}{footer:$getVar[footer]}{color:2f313};yes]]
$addReactions[🎯]
$setServerVar[New;no]
$onlyPerms[admin;Hey there, I have not been optimized for this server yet! Please ask someone with \`Administrator\` permissions to set me up!]
$endif
$if[$getServerVar[New]==no]
$editMessage[$get[id];{title:**TGTN Help UI**}{description:**[Support Server](https://discord.gg/FzfVVTzk6W)**〡**[Invite Me](https://discord.com/api/oauth2/authorize?client_id=766047560598028378&permissions=2483383377&scope=bot)〡[Website](https://gtnbot.com)**〡**[Vote Link](https://top.gg/bot/766047560598028378/vote)**
> **\`\`\`Formatting\`\`\`**
> \`[] - Mandatory\`
> \`<> - Optional\`
> \`() - Note\`
1️⃣ - General Commands
2️⃣ - GTN Commands
3️⃣ - Administrative Commands
4️⃣ - Tips
**TIP**: found a bug? Use \`$getServerVar[prefix]bug [bug here]\`
$if[$getUserVar[notif;$authorID]==yes]
<a:Alert:802714422187524096> -** A new update released!** Check it out with \`$getServerVar[prefix]changelog\`
$else
$endif }
{footer:$getVar[footer]}{color:00ff00}]
$wait[2s]
$awaitReaction[$authorID;5m;;🔙;remove;timed out]
$awaitReaction[$authorID;5m;;❌;close;timed out]
$awaitReaction[$authorID;5m;;1️⃣;1;timed out]
$awaitReaction[$authorID;5m;;2️⃣;2;timed out]
$awaitReaction[$authorID;5m;;3️⃣;3;timed out]
$awaitReaction[$authorID;5m;;4️⃣;4;timed out]
$addMessageReactions[$channelID;$get[id];🔙;❌;1️⃣;2️⃣;3️⃣;4️⃣]
$setUserVar[mid;$get[id]]
$let[id;$sendMessage[{title:Loading...}{description:<a:loading:809702938074808340> Please wait before reacting}{footer:$getVar[footer]}
{color:ff0000};yes]]
$onlyBotPerms[addreactions;managemessages;I am missing the permission \`add reactions\` or \`manage messages\` This is needed for the help ui to function!]
$endif
$cooldown[30s;Please wait until creating a new help UI. \`You need to wait %time%\`]
$onlyIf[$message==;]
$if[$getVar[command]==off]
$onlyForServers[$getVar[serverCommand];{title:Bot rewrite} {description:Hey there, unfortunately our bot is being rewritten, I will be fixed as good as new with the latest and most stable features in a few weeks! Please bare with me!} {color:ff000} {footer: - Dev team}]
$endif
`
}, {
name: "close",
code: `
$clearReactions[$channelID;$getUserVar[mid];all]
$onlyIf[$guildID!=;Commands not enabled in dms]
$onlyIf[$message==;
$editMessage[$getUserVar[mid];
{title:**__Help UI Closed__**} {description:Create another with \`$getServerVar[prefix]help\`
**[Support Server](https://discord.gg/FzfVVTzk6W)**〡**[Invite Me!](https://discord.com/api/oauth2/authorize?client_id=766047560598028378&permissions=2483383377&scope=bot)〡[Website](https://gtnbot.com)**}
{footer:$getVar[footer]} {color:ff0000}]`,
type:'awaitedCommand'
}
More:
Screenshots (If any): Image or Link
Explain how it works
Add a template.js to dev branch
like:
module.exports = async (d) => {
const code = d.command.code;
const inside = d.unpack();
const err = d.inside(inside);
if (err) return d.error(err);
const [value1,value2,value3] = inside.splits; //or inside for only 1 param
return {
code: code.replaceLast(`$template${inside}`, "to replace"),
};
};
so every function has the same structure.
Code used:
$httpRequest[https://pamdandabeta.glitch.me/api/t/info;post;{"prefix":"$message"};;$error;]
Done!
More:
ADD "Name"
$setTimeout[duration;timeout data;timeout heartbeat (optional);name]
bot.timeoutCommand({
name: "test",
// channel: "ID", (This is optional)
code: $sendDM[$timeoutData[userID];$timeoutData[message]]
});
please remove shitcode from your library as soon as possible, and do not force normal coders to cry
Features should be added to the $cpu command, for example $cpu[model] or $cpu[platform] $cpu must be $cpu[usage]
Model:
require ('os').cpus()[0].model
Platform :
require ('os').platform()
And the disk function:
module.exports = async (d) => {
return {
code: d.command.code.replaceLast(`$disk`, process.memoryUsage().rss / 1024 / 1024),
};
};
I don't know how the files are modified 😦
Aoi version 1.0.6
$songInfo[duration_left] doesn't works if we play a song through Spotify that means through $playSpotify please fix the bug
When i did a wiki !addwiki ur bot lagged it sended two times without saying !addwiki two times i just said 1
Add second field value option in $getEmbed ex: $getEmbed[$channelID;messageID;fvalue[2]] can get the second field value
name: "getServerTemplate",
code: `Here is Server Template;
$getServerTemplate`
}```
## Description
Server gives template link
Fix the typo in $killClient function.
Please add $setNsfwChannel That's very helpful :'-!
Code used:
Your Code Here
More:
Screenshots (If any): Image or Link
Code used:
$globalCooldown[1d;{title:Daily Rewards}{thumbnail:$authorAvatar}{description:You have claimed your daily rewards already!}{field:Claim again after:$getCooldownTime[globalUser;daily;no]}{color:f44336}]
Error get: ❌ Invalid cooldown type on $getCooldownTime[globalUser;daily;no] at line 7
More:
On $userInfo add Ability to track how users leave with user invite
Code used:
module.exports = ({
channel: "$channelID",
code: `$channelSendMessage[$channelID;popo;no]
$onlyif[$emojiToString==❤️;]`,
type: 'reactionRemoveCommand'
})
More:
1.0.6
Will return random emoji, if provided a guildID it will return random emoji from provided guild but if not it will return random emoji between all emojis
If $voice[$voiceID;membersCount] is typed, sends the number of users on the entered voice channel. But if $voice[all;membersCount] is typed, it will send the number of users on all audio channels. Even if the function is not exactly like this, something similar can be done.
Hi I'm Spaceflight Gaming,I have a function for aoi.js
Type- Function
$randomReply[Reply1;Reply1;etc]
Description-
This will support Variables,$randomText etc.
This will help making commands like Dank Memer Hunt Command, sometime your Rifle Brokes, sometime you die or you get something,so to make it, you should add $customReply which supports every function
Gets the members of the server not including bots.
Hey, there's a bug which makes a perticular part of code gets stuck to a perticular thing, and that's what's happening with me from 2 days. First my epouch var got bugged and I fixed it after hours, as I fixed it, a different var got bugged, and so on 4 more time... this is VERY annoying and I hate this. :(. If you're wondering, I fixed it by changing the var name in bot.variables and the var name in all the cmds. This bug started to happen as I updated to aoi.js 1.0.6 from dbd.js 3.0.6. I do not know what's the actual cause for this, but I am struggling very annoyingly. Kindly do try check why is this happening, and tell me a temporary fix till it's sorted. Ty.
More:
This will make the bot to await replies/reactions in a different channel.
Whats the difference between $clientID
and $client[id]
?
Please Make A Feature That Is Activites For Discord Like Youtube Together Please Make Itttttttt
$getConsoleError
$channelSendMessage[$channelID;$getConsoleError[$djsEval[falsis.hi;yes]];no]
Output:
$djsEval[falsis.hi;yes]
at line 1Explain how it works
Description
Creates an server leaderboard```
**Usage**
$serverLeaderboard[variable;asc/desc (optio al);{top} - {servername} - {value};list (optional);page (optional)]```
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.