GithubHelp home page GithubHelp logo

gawesomebot / bot Goto Github PK

View Code? Open in Web Editor NEW
380.0 27.0 184.0 15.57 MB

A super Awesome Discord bot

Home Page: https://gawesomebot.com

License: GNU General Public License v2.0

JavaScript 67.02% CSS 1.58% HTML 31.25% Shell 0.15%
discord chat-bot nodejs bulma discord-js gawesomebot gab discord-bots discord-bot

bot's Introduction

GAwesomeBot

Travis Status Codacy Badge GPL Licence Discord Server

Welcome to GAwesomeBot, the best Discord Bot! GAwesomeBot is the best all-purpose bot you'll find out there, packed with features in entertainment, utility and more, GAwesomeBot was designed to bring more activity to your server, while keeping control over it all with a rich web interface and advanced, but elegant moderation features. Give GAwesomeBot a try now!

Discord Bots

indev-4.0.2

This branch, against all odds, tracks a rewrite of GAB that will ultimately lead to GAB v4.1. You can contribute by opening pull requests as long as your commits follow our eslint rules. Remember that this version is in development, and as such code or features currently in the repo are unstable and may be modified and/or removed at any time in the future. To keep track of development, check out the 4.1 Trello board.

Stability Status Version Branch

This code of GAB runs in the development Version Branch. All code, features and apis are under development, and can not be considered finished or stable in any form. Code from this branch is not pushed to any GAB instances, and the maintainer Updater is disabled unless overridden for debugging purposes. This code should not be used for production, or testing. Instead, this code should only be used to contribute to the development of GAB, by making Pull Requests. Bug reports are currently ignored due to the early stage of development.

bot's People

Contributors

bitquote avatar chris92de avatar codacy-badger avatar dependabot-preview[bot] avatar dependabot[bot] avatar ffffaak avatar gilbert142 avatar gregorygregorygregory avatar hilbertgilbertson avatar sunburntrock89 avatar thehaden avatar thehydrogen avatar tttie avatar vladfrangu avatar wasdennnoch avatar zorbyte 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bot's Issues

[Bug] Error when trying to use extension.writeStore() in extension

When attempting to use extension.writeStore() you will be presented with an error.
Example code:

extension.writeStore("Test", "Something");

Error from Logs:

Failed to run command extension 'Project Release Announcement':
SyntaxError: Unexpected token u in JSON at position 0 at Object.parse (native)
at Extension.writeStore (/home/Gilbert/AwesomeBot/master/Modules/ExtensionStructures/Extension.js:13:28)
at evalmachine.<anonymous>:1:11
at Domain.extensionDomain.run (/home/Gilbert/AwesomeBot/master/Modules/ExtensionRunner.js:19:18)
at Domain.run (domain.js:221:14)
at fs.readFile.err (/home/Gilbert/AwesomeBot/master/Modules/ExtensionRunner.js:17:21)
at tryToString (fs.js:449:3) at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:436:12) 

Request: Allow extension names and command keys with 2 characters

Currently there seem to be a restriction in place which prevents the use of extension names and/or command keys with less than 3 characters.

If possible I would at least like this restriction lowered to 2 characters (but I don't see why it needs to be higher than 1).

[Bug] Tags don't respect the admin-only setting

Having found out on Aurora Community about the ability for anyone to run /tag name | test, even with the option in the admin console being Admin-only.

This might be just a slight overlook, hence the needs confirmation label

[Request] Reason command should also change the strike message when running /strikes

Now, this request can break backward compatibility

Currently, when running /reason, it only changes the modlog reason. it should also find the correspondent strike and edit that message, so when running /strikes @User you get the same strike message as the modlog reason.
Probably easy to do, by adding some counter to each strike, or using the modlog id in the strikes, and then making reason edit them both. AGAIN, this can potentially fuck backward compatibility if implemented

[Request / Idea] Switch to Google Translate

As Microsoft's Translator API requires a subscription (be it free) on portal.azure.com (which asks you for a credit card to verify your a human), Google seems like another decent solution, its very easy to make API keys and set them up,

Needs people's feedback

[bug] permissionOverwrites.has

In an extension when using bot.isMuted():

error: Failed to run command extension 'exp': TypeError: ch.permissionOverwrites.get(...).has is not a function at Bot.bot.isMuted (Platform/Discord.js:511:145)

When using bot.muteMember():

Failed to run command extension 'exp': TypeError: ch.permissionOverwrites.get(...).has is not a function at Client.bot.isMuted (Platform/Discord.js:511:145) at Bot.bot.muteMember (Platform/Discord.js:516:11)

Reason: has is not a function.

permissionOverwrites.has is passed as a variable! Simple fix on its way shortly (currently trying to finish the Extensions API wiki).

[Bug] Ongoing activites

URL: https://bot.lachy.io/dashboard/other/ongoing-activities?svrid=****************
Error
`TypeError: /root/GAwesomeBot/Web/views/pages/admin-ongoing-activities.ejs:66
64|


65|


66| <%= trivia[i].set.charAt(0) + trivia[i].set.slice(1)
67|


68|

69|

trivia[i].set.charAt is not a function
at eval (eval at (/root/GAwesomeBot/node_modules/ejs/lib/ejs.js:481:12), :538:38)
at returnedFn (/root/GAwesomeBot/node_modules/ejs/lib/ejs.js:512:17)
at View.exports.renderFile [as engine] (/root/GAwesomeBot/node_modules/ejs/lib/ejs.js:364:31)
at View.render (/root/GAwesomeBot/node_modules/express/lib/view.js:126:8)
at tryRender (/root/GAwesomeBot/node_modules/express/lib/application.js:639:10)
at EventEmitter.render (/root/GAwesomeBot/node_modules/express/lib/application.js:591:3)
at ServerResponse.render (/root/GAwesomeBot/node_modules/express/lib/response.js:960:7)
at checkAuth (/root/GAwesomeBot/Web/WebServer.js:3333:8)
at db.servers.findOne (/root/GAwesomeBot/Web/WebServer.js:683:10)
at Query. (/root/GAwesomeBot/node_modules/mongoose/lib/model.js:3419:16)
at /root/GAwesomeBot/node_modules/kareem/index.js:264:21
at /root/GAwesomeBot/node_modules/kareem/index.js:127:16
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)`

[Request] Prevent disabling of the enable of disable commands

Yes, this has to be done cause some people might attempt {prefix}disable enable which will disable it on the channel. Also, disabling the disable command should also be forbidden, unless globally from the Admin Panel. Same applies with enable

[Request] Alias msg to message in Extensions

As you know, message is what you have to use in order to get the message content.

Have I not tried msg before, with a catastrophic failure, this wouldn't have been it
It would be nice if we can have msg, as we are very used to it, its faster to type, and has the same properties

Broken Auto-Admin-Assign

We've all been there;
You invite GAB into your server, and notice you can't access the admin panel for some reason, even though you're the server owner!
A few moments later, your server is complete chaos because a member with the role Trusted found out that only they can access the admin panel. Woops.

The Auto Assigning of Admin roles upon creating a server config for the first time is horribly, horribly broken. And can cause a ton of issues. Sometimes, staff is completely locked out, and requires the bot maintainer to either join their server and access their config, or edit the DB directly. Annoying as all.

We need to give the Auto Assigning a good look, and hit it a few times with a stick, because it's been really bad. Really, really bad.

[Bug] Dog command not working

This will be fixed as of the embedding PR.

Seems like when they made the dog command, they made it very bad, and very lazily. As such, the command doesn't work.

[bug] [userobject].createMessage in extensions won't work when passed through member object

In an extension, DMing the message author is easy (message.author.createMessage('abc')), but there seems to be no way to DM another user (e.g. a user by ID or by mention). The eris User object contains the getDMChannel() function, which returns a channel object for the user (channel.createMessage), so they can be DM'd.

In extensions, User.js contains a createMessage() function which uses erisUser.getDMChannel(), so we can simply execute [userobject].createMessage() to DM the user. E.g. we can use message.author.createMessage (Message.js fetches the user object from User.js and returns this through message.author) in an extension.

But what if we don't have a user object for a user? e.g. we have a command extension where want to send a DM to a user by their UID. In an extension, we can't get a user object by ID but we can get the user's Member object by guild.members.get(UID). Helpfully, the eris Member object returns a .user property - providing GAB the user object and so guild.members.get(UID).user returns the user object from User.js.

So what's the problem?

Try running guild.members.get(UID HERE).user.createMessage('abc') and we get: Cannot read property 'getDMChannel' of undefined at ExtendedUser.getDMChannel (in User.js). I'm still trying to figure out what exactly is going on here.

[Bug] mentions not working in extensions

When trying to use message.mentions within an extension, nothing happens. No error is produced in the logs to indicate the object is undefined. But it would appear to be completely empty.

To reproduce:
channel.createMessage(message.mentions.length)
Run the extension, mentioning as many or as few users as you wish.

Result: nothing, not even 0. No errors occur, nor is any message produced.

As for roleMentions, only role IDs are returned when mentioning a guild role (rather than the object for that role). Evidently something has been left unfinished. In Modules/ExtensionStructures/Message.js:
class Message { // TODO: // 1. roleMentions should be Array(Role) instead? (Not how eris works tho) ...

[Bug] Missing Extensions dir.

The lack of a dir named "Extensions" in GAB's root causes failure when trying to save extension code (.abtext files). Extension metadata is fine as it's saved elsewhere in mongoDB

[BUG] bufferUtil error when accessing admin console.

OS: Arch Linux
Branch: master and development
node version: 6.2.2, 6.9.5, 7.5.0
socket.io version: 1.4.8, 1.7.2

Bot runs normally until I tried to change any options like command options from the admin console.
The same error instantly happened without opening or refreshing the admin console page when restarting the bot.

/home/lealith/GAwesomeBot/node_modules/engine.io/node_modules/ws/lib/Receiver.js:306
  if (mask != null && buf != null) bufferUtil.unmask(buf, mask);
                                             ^

TypeError: Cannot read property 'unmask' of undefined
    at Receiver.unmask (/home/lealith/GAwesomeBot/node_modules/engine.io/node_modules/ws/lib/Receiver.js:306:46)
    at Receiver.finish (/home/lealith/GAwesomeBot/node_modules/engine.io/node_modules/ws/lib/Receiver.js:505:25)
    at Receiver.expectHandler (/home/lealith/GAwesomeBot/node_modules/engine.io/node_modules/ws/lib/Receiver.js:493:33)
    at Receiver.add (/home/lealith/GAwesomeBot/node_modules/engine.io/node_modules/ws/lib/Receiver.js:103:24)
    at Socket.realHandler (/home/lealith/GAwesomeBot/node_modules/engine.io/node_modules/ws/lib/WebSocket.js:825:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at TCP.onread (net.js:548:20)

[Bug] anime API broken

Not a bug with (G)AB itself, but the Hummingbird API (which anime.js uses) has been scrapped. Its replacement, the Kitsu API, is very new (last month) and application registration is soon to be introduced (see here and here).

Once the Kitsu API introduces application registration (it looks as though public API keys [per the first link above] are to be phased out), anime.js can be updated, along with auth.json to support self-hosters' API keys. Either that, or the anime command could be scrapped.

[BUG] Bot sends MOTD everytime bot restarts

Hi, this seems like a pretty natural bug, but it can be very annoying if the bot often crashes and auto restarts

What occurs is while the bot does send the MOTD every X amount of time, however if the bot stops/crashes, and is auto restarted, for instance with PM2, it will send the MOTD again, probably also resetting the timer.

Such as in this picture The first one is when I first added the MOTD. normal
The second was when I restarted the bot, not normal :P

[Web Bug] When using profile tags, they don't delete on the webpage

Testing on my local copy where I'm embedding things, I've noticed that the deletion of profile tags profile <tag>|<value> doesn't work. As the code suggests, if the value is either empty or a ., it should remove it from the database and the webpage. But it doesn't, instead, on the webpage, it shows an empty tag. The tag does get deleted from the DB tho.

The bot doesn't recognize the tag however, attempting to see it will "error", saying it is not existent.

Error with "Length" when accessing (siteurl)/dashboard

0|GAwesome | TypeError: Cannot read property 'length' of undefined 0|GAwesome | at addServerData (/root/GAwesomeBot/Web/WebServer.js:1693:25) 0|GAwesome | at app.get (/root/GAwesomeBot/Web/WebServer.js:1725:4) 0|GAwesome | at Layer.handle [as handle_request] (/root/GAwesomeBot/node_modules/express/lib/router/layer.js:95:5) 0|GAwesome | at next (/root/GAwesomeBot/node_modules/express/lib/router/route.js:131:13) 0|GAwesome | at Route.dispatch (/root/GAwesomeBot/node_modules/express/lib/router/route.js:112:3) 0|GAwesome | at Layer.handle [as handle_request] (/root/GAwesomeBot/node_modules/express/lib/router/layer.js:95:5) 0|GAwesome | at /root/GAwesomeBot/node_modules/express/lib/router/index.js:277:22 0|GAwesome | at Function.process_params (/root/GAwesomeBot/node_modules/express/lib/router/index.js:330:12) 0|GAwesome | at next (/root/GAwesomeBot/node_modules/express/lib/router/index.js:271:10) 0|GAwesome | at Layer.handle [as handle_request] (/root/GAwesomeBot/node_modules/express/lib/router/layer.js:91:12) 0|GAwesome | at trim_prefix (/root/GAwesomeBot/node_modules/express/lib/router/index.js:312:13) 0|GAwesome | at /root/GAwesomeBot/node_modules/express/lib/router/index.js:280:7 0|GAwesome | at Function.process_params (/root/GAwesomeBot/node_modules/express/lib/router/index.js:330:12) 0|GAwesome | at next (/root/GAwesomeBot/node_modules/express/lib/router/index.js:271:10) 0|GAwesome | at app.use (/root/GAwesomeBot/Web/WebServer.js:163:3) 0|GAwesome | at Layer.handle [as handle_request] (/root/GAwesomeBot/node_modules/express/lib/router/layer.js:95:5) 0|GAwesome | at trim_prefix (/root/GAwesomeBot/node_modules/express/lib/router/index.js:312:13) 0|GAwesome | at /root/GAwesomeBot/node_modules/express/lib/router/index.js:280:7 0|GAwesome | at Function.process_params (/root/GAwesomeBot/node_modules/express/lib/router/index.js:330:12) 0|GAwesome | at next (/root/GAwesomeBot/node_modules/express/lib/router/index.js:271:10) 0|GAwesome | at SessionStrategy.strategy.pass (/root/GAwesomeBot/node_modules/passport/lib/middleware/authenticate.js:325:9) 0|GAwesome | at /root/GAwesomeBot/node_modules/passport/lib/strategies/session.js:65:12

URL: https://bot.lachy.io/dashboard

[Request] make mute command server-wide

Currently (if I understand correctly), the mute command will only mute the user in the current channel. I would like to be able to mute a user in all channels at once. As an idea on how to do this, take a look at NadekoBot. They simply create a mute role, which is automatically added to all channels, with permission to post denied. Then, when a user is muted using the mute command, the user will just be added to the mute role.

[Bug] <p> tags escaped in boxes

In some text boxes (such as extension descriptions and server publish descriptions) the description is nested in a visible p and closing p tag due to cross-site-scripting prevention mixed with markdown generation. Fix coming today.

[Bug] [development] userDocument not auto-created on member join

Really can't explain it using the tile, so I'll do it here.

Basically, you got a new-comer on your server. Checking his strikes would yield a "Something went wrong", This is most likely due to the strikes array not being initialised. (I think)

Striking and then removing fixes that issue

[Issue] New issue where bot will not store warnings

Hi, just recently I discovered my bot wasn't recording strikes to the database.
I have tried downloading fresh copies of the dev builds, and dropping the database, but its an issue in the code.
I have went as far as to do a full linux os reinstall. Still the same issue.
The bot will still post it to a modlog channel and dm the user.

[bug] Replace Translation API

Following discussion in #96, investigations have revealed a bit of a problem.

The current translation API uses Microsoft DataMarket, which is being retired on 31st March. Old keys will thus stop working. New keys, with Microsoft Cognitive Services API, absolutely can be created with Microsoft for free (although a debit/credit card and SMS verification are needed) - with exactly the same limitations as before (the free package with up to 2 million chars per month). However, these new keys won't currently work with GAB as the translate command uses bing-translate; last updated 2 years ago.

Instead we need to switch to something like mstranslator, which uses the Cognitive Services API.

Or the alternative is to switch to an entirely different API.

Music command in DB in existing installs

Those with GAB development installs predating the removal of the music command (#12) should ensure they remove the music command array from each server document->commands array under the servers collection in mongodb, as the disable command results in an error otherwise.

I found the disable command (which, when run without any parameters, is supposed to output a list of disabled commands) was producing a 'Something went wrong' response and logging Cannot read property 'disabled_channel_ids' of undefined - the undefined turns out to be the music command, as disable loops through all commands in the database commands array. Similar errors may occur elsewhere so those with installs predating #12 would be best advised to remove the music command from their mongodb.

Request: Provide Docker container for self-hosters

It would be super efficient and easy for all self-hosters if they could simply pull a docker image and run the bot in a container. That way everything could be provided by the maintainer and self-hosters would not have to deal with stuff they have no clue about (like node.js, mongoDB etc.).

[Bug] Error while saving Spam Data

Welp, found the part of the code that errors, now to debug why it errors.

setTimeout(() => { spamDocument = channelDocument.spam_filter_data.id(msg.author.id); if(spamDocument) { spamDocument.remove(); serverDocument.save(err => { winston.error("Failed to save server data for spam filter", {svrid: msg.guild.id}, err); }); } }, 45000);

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.