GithubHelp home page GithubHelp logo

aoijs / aoi.js Goto Github PK

View Code? Open in Web Editor NEW
329.0 15.0 130.0 6.17 MB

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

JavaScript 100.00%
slash-commands aoi callbacks music bots discord aoi-js functions aoijs nodejs

aoi.js's People

Contributors

azusfin avatar baka-aho avatar berat141 avatar berticulousnert avatar dbthesecond avatar dependabot[bot] avatar devspen avatar dutchman-dev avatar eltuna avatar ethann2004 avatar faf4a avatar itzleref avatar kino7916 avatar kirmiwdev avatar kubaturi avatar leref avatar lightnerdev avatar masterguy35 avatar mustafaamsy avatar pranav-karthikeyan avatar rakejs avatar rilecraft avatar slyrith avatar soudblox avatar stickman1199 avatar themarci avatar usersatoshi avatar xzfirzal avatar yuzutheneko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aoi.js's Issues

$botPing bug

!ping

module.exports = ({
name: "ping", 
code: `$description[Mensajes__($ping)__ - Api__($botPing)__ - DB__($dbPing)__]
$color[2475E3]`
});

Check out the AstroBot bot, -33 ping :u
and I use a host with 2GB ram 5GB disk and 100% cpu, it is not so much

create guild function

  • [ ✓] Functions: $createGuild, $setGuildOwner
  • Callbacks:
  • Handlers:
  • Others:

Description

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

New Function

  • Function Name: $messageCollector

Description

$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.

$handlerror

Type

  • Functions: $handlererror[awaited command name]
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

Description

this will let {error} be handled in an awaited command for error handling

$if statement bug

Type

  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

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]]]

bot.botJoinCommand is broken/bugged

Type

  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

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:

  • Aoi.js version: 1.0.6
  • Node.js version: discord.js 12
  • Operating system: Windows 10
    ISSUE: bot.botJoinCommand is broken as it returns: invalid channel ID but bot.botLeaveCommand works with the same channel ID.
    Screenshots (If any): Image or Link

Lavalink Music Changes

Type

  • Functions: About all music functions

Description

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.

$getLeaderboardValue

Type

  • Functions: <$getLeaderboardValue>

Description

gets varible values by leaderboard position
Usage:
$getLeaderboardValue[variable name;variable type (user/globalUser/server);asc/desc;position;{servername} - {value} - {server id}]

$setservervar | $getservervar saving globally.

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

A suggestion!

Type

  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: Stuff about Github

Description

You guys should post releases 😃

$ignoreChannels

Type

  • Functions: \ $ignoreChannels[channelID;channelID;channelID;...;error message]
    - Callbacks: <Callback Name>
    - Handlers: <Handler Type>
    - Others: ______

Description

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.

$channel doesn't work

Type

  • Bug Fix
  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

Code used:

$channel[$channelID;created]
all properties too

More:

  • Aoi.js version: 1.0.1

Well... $channel function is not working, all properties don't work
image

$djsEval Partially bug

Function

$djsEval

  • Code:
$djsEval[ async (d) => {
d.client.users.cache.get(message.author.id)
};yes]
  • Output :
async (d) => {
d.client.users.cache.get(message.author.id)
}

Async is not used in djsEval. We need it.

More:

  • Aoi.js version: 1.0.6
  • Node.js version: idk Latest version

Screenshots (If any): IMG_20210516_024605.jpg

$awaitReaction doesnt work with $sendMessage

Type

  • Functions: $reactionCollector $awaitReaction $sendMessage
  • Callbacks:
  • Handlers: Defualt aoi.js
  • Others:
  • NOTE: Since ive been expirimenting the code contains inconsistencys, but point is i couldnt get the functions to cooperate

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:

  • Aoi.js version: Latest
  • Node.js version:
  • Operating system:

Screenshots (If any): Image or Link

Template for creating fucntion

Type

  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • [ X] Others: ______Template

Description

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.

$httpRequest: Method POST doesn't work

Type

  • Functions: $httpRequest
  • Callbacks: Triggering command with message
  • Handlers: None
  • Others: METHOD: Post || Bot and Website in 1 project: Express and Aoi.JS || Hosting: Glitch

Code used:

$httpRequest[https://pamdandabeta.glitch.me/api/t/info;post;{"prefix":"$message"};;$error;]
Done! 

More:

  • Aoi.js version: 1.0.0
  • Node.js version: 12.x.x
  • Operating system: Linux

Add "Name" in TimeOut

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]]
});

remove shitcode from your library

Type

  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Other

Description

please remove shitcode from your library as soon as possible, and do not force normal coders to cry

$cpu features & $disk

  • Functions: $cpu[property], $disk

Description

Features should be added to the $cpu command, for example $cpu[model] or $cpu[platform] $cpu must be $cpu[usage]

Codes

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),
    };
  };

Uh :/

I don't know how the files are modified 😦

$queue[] is broken?

now playing: flamingo remix
current queue:
1.) bad apple
2.) bad apple remix
^ this is my current queue. And i noticed that there is an error, i evaled it and...
Screenshot (43)

Spotify bug

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

Master Bot Lagged

When i did a wiki !addwiki ur bot lagged it sended two times without saying !addwiki two times i just said 1

Fix $randomEmoji

Type

  • [x ] Functions: $randomEmoji
  • Callbacks:
  • Handlers:
  • Others:

Code used:
84E09B8C-DEF2-4D4B-A663-4DC38D873E31
DA17922E-C8F1-40F8-BB74-F22C5350BD38

Your Code Here
d!eval $randomEmoji (this is how i used it)

More:

  • Aoi.js version:
  • Node.js version:
  • Operating system:

Screenshots (If any): Image or Link

$getServerTemplate

Type

  • Functions: \
  • Callbacks: \
  • Handlers: \
  • Others: ______

Code Used

  name: "getServerTemplate",
  code: `Here is Server Template;
$getServerTemplate`
}```

## Description
Server gives template link

voicestateupdate error

Type

  • Functions: <Function Name>
  • Callbacks: \voice state updates
  • Handlers: <Handler Type>
  • Others: ______

Code used:

a voice state update

More:

  • Aoi.js version: 1.0.1
  • Node.js version: 12
  • Operating system: linxus

Screenshots (If any): Image or Link
image
**This stops the whole program on error **

$sendMessage is bugged

$sendMessage has two fields but the second one is optional right?
It gave this error in the photo for some reason
Screenshot_20210501-132154

Added $setNsfwChannel

Type

  • Functions: $setNsfwChannel

Description

Please add $setNsfwChannel That's very helpful :'-!

$getCooldownTime error

Type

  • Functions: $getCooldownTime
  • Callbacks: <Callback Name>
  • Handlers: $loadCommands
  • Others: ______

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:

  • Aoi.js version: 1.0.6
  • Node.js version: v12.22.1
  • Operating system: Debian

Screenshots (If any): Image or Link
Screenshot_2021_0513_151105
Screenshot_2021_0513_151137

$userInfo suggestion

Type

  • [function ] Functions: <$userInfo>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

Description

On $userInfo add Ability to track how users leave with user invite

reactionRemoveCommand not working

Type

  • Bug fix: yes
  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

Code used:

module.exports = ({
    channel: "$channelID",
    code: `$channelSendMessage[$channelID;popo;no]
$onlyif[$emojiToString==❤️;]`,
    type: 'reactionRemoveCommand'
})

More:

  • Aoi.js 1.0.6
  • Node.js idk
    The message is not sent, and this is spamming the console. Many of my reactionRemove commands are not working now. But that code in the reactionAdd commands works.

popo

New func

Type

  • Functions: $randomEmoji[guildID]
  • Callbacks:
  • Handlers:
  • Others: -

Description

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

Function showing the number of users in the voice channel

Type

  • Functions: <$voice[channelID/all;membersCount]>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

Description

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.

$customReply

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

$justMembersCount

Type

  • Functions: $justMembersCount

Description

Gets the members of the server not including bots.

A perticular var's $getGlobalUserVar is getting stuck to a weird value in all the cmds which contain the $getGlobalUserVar of the var.

Type

  • Functions: <not a perticular one, but happening in a $getGlobalUserVar>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______
    Happening in most of my commands, like, first it will happen in Commands which contain "$getGlobalUserVar" of a perticular var. Read below.

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:

  • Aoi.js version: 1.0.6
  • Node.js version: Wut?
  • Operating system: Android

Remove $clientID

Description

Whats the difference between $clientID and $client[id]?

$getConsoleError function

$getConsoleError

Type

Functions

Description

Sends the error on the console of the command used.

Usage;

$getConsoleError

Example

$channelSendMessage[$channelID;$getConsoleError[$djsEval[falsis.hi;yes]];no]

Output:

  • falsis is not defined in $djsEval[falsis.hi;yes] at line 1

$globalUserLeaderboard

Type

  • Functions: <Function Name>
  • Callbacks: <Callback Name>
  • Handlers: <Handler Type>
  • Others: ______

Description

Explain how it works

$serverLeaderboard

Description

Creates an server leaderboard```

**Usage**

$serverLeaderboard[variable;asc/desc (optio al);{top} - {servername} - {value};list (optional);page (optional)]```

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.