Coder Social home page Coder Social logo

cog-creators / red-discordbot Goto Github PK

View Code? Open in Web Editor NEW
4.5K 214.0 2.2K 78.8 MB

A multi-function Discord bot

Home Page: https://docs.discord.red

License: GNU General Public License v3.0

Python 98.88% Batchfile 0.05% Makefile 0.06% HTML 0.02% PLpgSQL 0.90% PowerShell 0.10%
discord bot trivia music moderation fun modular chatbot hacktoberfest discord-bot

red-discordbot's Introduction


Red - Discord Bot
Red Discord Bot

Music, Moderation, Trivia, Stream Alerts and Fully Modular.

Discord Server PyPI PyPI - Python Version discord.py Support Red on Patreon!

GitHub Actions Red on readthedocs.org Code Style: Black Localized with Crowdin

OverviewInstallationDocumentationPluginsCommunityLicense

Overview

Red is a fully modular bot – meaning all features and commands can be enabled/disabled to your liking, making it completely customizable. This is a self-hosted bot – meaning you will need to host and maintain your own instance. You can turn Red into an admin bot, music bot, trivia bot, new best friend or all of these together!

Installation is easy, and you do NOT need to know anything about coding! Aside from installing and updating, every part of the bot can be controlled from within Discord.

The default set of modules includes and is not limited to:

  • Moderation features (kick/ban/softban/hackban, mod-log, filter, chat cleanup)
  • Trivia (lists are included and can be easily added)
  • Music features (YouTube, SoundCloud, local files, playlists, queues)
  • Stream alerts (Twitch, Youtube, Picarto)
  • Bank (slot machine, user credits)
  • Custom commands
  • Imgur/gif search
  • Admin automation (self-role assignment, cross-server announcements, mod-mail reports)
  • Customisable command permissions

Additionally, other plugins (cogs) can be easily found and added from our growing community of cog repositories.

Installation

The following platforms are officially supported:

If after reading the guide you are still experiencing issues, feel free to join the Official Discord Server and ask in the #support channel for help.

Plugins

Red is fully modular, allowing you to load and unload plugins of your choice, and install 3rd party plugins directly from Discord! A few examples are:

  • Cleverbot integration (talk to Red and she talks back)
  • Ban sync
  • Welcome messages
  • Casino
  • Reaction roles
  • Slow Mode
  • AniList
  • And much, much more!

Feel free to take a peek at a list of available 3rd party cogs!

Join the community!

Red is in continuous development, and it’s supported by an active community which produces new content (cogs/plugins) for everyone to enjoy. New features are constantly added. If you can’t find the cog you’re looking for, consult our guide on building your own cogs!

Join us on our Official Discord Server!

License

Released under the GNU GPL v3 license.

Red is named after the main character of "Transistor", a video game by Super Giant Games.

Artwork created by Sinlaire on Deviant Art for the Red Discord Bot Project.

This project vendors discord.ext.menus package made by Danny Y. (Rapptz) which is distributed under MIT License. A copy of this license can be found in the discord-ext-menus.LICENSE file in the redbot/vendored folder of this repository.

red-discordbot's People

Contributors

aikaterna avatar bobloy avatar dav-git avatar devilxd avatar discordliz avatar drapersniper avatar fixator10 avatar flame442 avatar flaree avatar github-actions[bot] avatar jackenmen avatar kowlin avatar kreusada avatar laggron42 avatar ltzmax avatar madebylydia avatar mikeshardmind avatar neuroassassin avatar owocado avatar palmtree5 avatar predaaa avatar redjumpman avatar stonedestroyer avatar tekulvw avatar tobotimus avatar trustyjaid avatar twentysix26 avatar vexed01 avatar yamikaitou avatar zephyrkul 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  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

red-discordbot's Issues

Feature Request : addToPlaylist

If the bot had such a command which allows to add a music to specific playlist, it would be great and useful.. for example !addToPlaylist PlaylistName URL

Unknown issue preventing Red startup (V2)

http://i.imgur.com/fqZS4jH.png

Prior to this error occuring, my system administrator decided to do a shitton of fucking around followed by a system restore. After reinstalling python package dependencies (such as youtube_dl etc) and repairing the python installation (in an attempt to isolate the issue), I failed to identify the problem, or resolve it. It occurs after it prints "Loading Cogs" shortly after displaying that message, it starts a traceback, most of which is visible in that screenshot. I also tried rebooting while writing this message, but as I feared, that did nothing.

Soundcloud [Question]

I wrote a little feature to play single songs from soundcloud but the api doesn't use async / aiohttp. My question is should i make a pull requests or not. The code isn't really finished too only to test the new function.

Adding Google Play Music Support

I've thrown together a prototype for google play music integration.

I was wondering if we could create a new feature branch so I could get some feedback and gauge interest?

Suggestion: Utilise "In-Game" as a "Now Playing" thing

As it says on the tin. I'm trying to do this myself, but with literally no experience with Python... I'm setting off syntax errors or trying to call on shit that doesn't exist there.

Take a look and laugh at my attempt to add it...

def getVideo(self, url):
        try:
            yt = youtube_dl.YoutubeDL(youtube_dl_options)
            v = yt.extract_info(url, download=False)
            if not os.path.isfile("cache/" + v["id"]):
                logger.info("Track not in cache, downloading...")
                v = yt.extract_info(url, download=True)
            self.currentTitle = v["title"]
            client.change_status(discord.Game(name=v["title"]))     
            return v["id"]
        except Exception as e:
            logger.error(e)
            return False

Idea: Score tracking

Add the ability to type say "Fridge_nz++ (or --) for suggesting ideas" which will add 1 point to fridge's total and save the reason for the points. then !score fridge_nz will return the score a person has accumulated and the reasons for each point.

Idea copied from Hubot if you want to see its code, its in coffeescript tho

Features suggestion

While there is a !choose feature, another nice feature would be a vote/poll commands. Another feature that would be nice to have are raffle commands.

For the poll/vote (will use just poll to keep it simple) commands they could be (inspired by nightbot):
!pollstart [option1 or option2, etc]
!pollstop - stops the poll and displays results
!pollreset
!vote [option] - for those voting

For the raffle, some commands can be:
!raffleon/off
!winner - selects a random individual in the chat

Thank you so very much for creating this bot! My friends and I have enjoyed using it and greatly appreciate your work! These were just a few features I thought would be useful ^_^

Suggestion: auto delete messages after x seconds

This could be useful to prevent the chat getting cluttered.

Having it as an option would be nice, with a configurable timer.
also, deleting both the bots messages and (some) command messages sent by users

Small bug in getPreviousSong(self)

The first line under the except should be
song = self.playlist[len(self.playlist)-1]
not
song = self.playlist[len(self.current)-1]

The idea is to wrap around the array if you are at the beginning. The result is that the prev/previous command doesn't work correctly.

P.S. I have copied the repo for use on a private server, and have edited the code to make playlists only play once by default, but have also edited the commands to allow for playlist repeating. I'd be willing to share the code with you if you want. Just let me know.

More trivia lists

Now that the trivia system is completed it needs good lists of questions.
There are plenty of BAD lists floating around, with impossible to guess answers or just bad quality in general. If anyone is willing to help it would be greatly appreciated, my goal is to have at least a few of various topics and a good total number of questions.
The format is easy, one question per line and it supports multiple answers (as many as you want):

    question`answer1`answer2`answer3`

Will it work on linux?

So i want to have a bot on 24/7 and am thinking about buying a raspberry pi to run it on with linux but i don't know if this bot will run on that prob not because of the dll file but i wanna know if its possible maybe even with a workaround

wont allow me

error: could not create 'c:\program files (x86)\python35-32\Lib\site-packages\chardet': Access is denied
this keeps comming

Queue command to show queue

Would be nice if typing !queue (with no link) or something similar would show what's coming up in the current queue. :)

Issue when attempting to play music

Hi, I'm seeing the following in the console when trying to use !youtube

Ignoring exception in on_message
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/discord/client.py", line 259, in _run_event
yield from getattr(self, event)(_args, *_kwargs)
File "red.py", line 290, in on_message
await playVideo(message)
File "red.py", line 1238, in playVideo
currentPlaylist = Playlist(data)
File "red.py", line 618, in init
self.playSingleSong(self.playlist[0])
File "red.py", line 682, in playSingleSong
musicPlayer.start()
AttributeError: 'generator' object has no attribute 'start'
Ignoring exception in on_message
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/discord/client.py", line 259, in _run_event
yield from getattr(self, event)(_args, *_kwargs)
File "red.py", line 290, in on_message
await playVideo(message)
File "red.py", line 1234, in playVideo
stopMusic()
File "red.py", line 1370, in stopMusic
musicPlayer.stop()
AttributeError: 'generator' object has no attribute 'stop'
^CTraceback (most recent call last):
File "red.py", line 2048, in
loop.run_until_complete(main())
File "/usr/local/lib/python3.5/asyncio/base_events.py", line 330, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.5/asyncio/base_events.py", line 301, in run_forever
self._run_once()
File "/usr/local/lib/python3.5/asyncio/base_events.py", line 1162, in _run_once
event_list = self._selector.select(timeout)
File "/usr/local/lib/python3.5/selectors.py", line 432, in select
fd_event_list = self._epoll.poll(timeout, max_ev)

Error when trying to stream a local file

Ignoring exception in on_message
Traceback (most recent call last):
File "red.py", line 445, in nextSong
if isPlaylistValid([self.playlist[nextTrack]]): #Checks if it's a valid youtube link
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/python351/lib/python3.5/site-packages/discord/client.py", line 251, in _run_event
yield from getattr(self, event)(_args, *_kwargs)
File "red.py", line 198, in on_message
await playLocal(message)
File "red.py", line 944, in playLocal
currentPlaylist = Playlist(data)
File "red.py", line 437, in init
self.nextSong(0)
File "red.py", line 464, in nextSong
logger.warning("Something went wrong with track " + self.playlist[self.current])
IndexError: list index out of range

CentOS 6 64bit

Trivia error

Got this error, seems I got the question right but it skipped to the next one instead of announcing the right answer or anything.

Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\discord\client.py", line 254, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "red.py", line 319, in on_message
    await trvsession.checkAnswer(message)
  File "red.py", line 490, in checkAnswer
    await client.send_message(self.channel, "You got it {}! **+1** to you!".format(message.author.name))
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\discord\client.py", line 947, in send_message
    yield from utils._verify_successful_response(resp)
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\discord\utils.py", line 175, in _verify_successful_response
    data = yield from response.json()
  File "C:\Program Files (x86)\Python35-32\lib\site-packages\aiohttp\client_reqrep.py", line 756, in json
    return loads(stripped.decode(encoding))
  File "C:\Program Files (x86)\Python35-32\lib\json\__init__.py", line 319, in loads
    return _default_decoder.decode(s)
  File "C:\Program Files (x86)\Python35-32\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Program Files (x86)\Python35-32\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Error stopping music player from working

Checking for permission to "manage_messages" on line 1378 of red.py prevents the Youtube player from working as it hangs while checking for permissions to manage messages:

return message.channel.permissions_for(message.server.me).manage_messages

Changing the line as such should fix the issue:

return message.channel.permissions_for(message.server.me).can_manage_messages

Error removing badwords

Traceback (most recent call last):
File "/usr/local/python351/lib/python3.5/site-packages/discord/client.py", line 251, in _run_event
yield from getattr(self, event)(_args, *_kwargs)
File "red.py", line 263, in on_message
await removeBadWords(message)
File "red.py", line 1265, in removeBadWords
dataIO.saveFilter(badwords)
AttributeError: module 'dataIO' has no attribute 'saveFilter'

Clear cache

Does this currently have an option to clear the cache automatically? It would be nice to have that functionality in so it doesn't clog up your disk. Maybe implement a max amount of songs in the cache or something.

Sytax error

It wont run, this is all I know.

E:\Bots\Red-DiscordBot>python red.py File "red.py", line 35 async def on_ready(): ^ SyntaxError: invalid syntax

Suggestion: a !quote function

Something like "!quote Some text to add" to add the quote to a flat file. Using !quote with no operators will pick a random quote from the file or !quote [number] to get a specific quote.

twitch.json channel entries are disappearing

For some reason the twitch.json file will clear itself of any entries once in a while. Only one Twitch channel was added.

I did change the CHECK_DELAY to 60 because I was running into an issue where the streamer or Twitch was having broadcast issues and with a delay of 10 would pick up on the restart of the stream causing a repeat of the live message. I don't believe that is what is causing my issue though.

The only thing I can think of that is causing this is the section of twitchAlert that involves finding an error in the Twitch API causing the stream to be removed from the list.

TwitchAlert task crashing bot

About every five minutes I get this:
[17/01/2016 17:52] ERROR: type object got multiple values for keyword argument '
mute'
Task was destroyed but it is pending!
task: <Task pending coro=<twitchAlert() running at red.py:1646> wait_for=>
Why does it keep doing this? The Twitch.json is empty and nobody has used a twitch command in my server.

Prevent queue looping

Hey Twentysix! Thanks a lot adding SoundCloud support on the developer branch (don't know where else to say it, lol). Will definitely donate whenever I'm not a poor student anymore, haha.

I was just wondering, is there any way to prevent the queue from looping? For example, if I play just a single song with "!play", it will loop continously until someone types "!stop".

I looked everywhere and even tried disabling queue mode but it's still looping everytime.

Thanks!

1 bug and 1 suggestion

Hello,

Very nice bot! Had lots of fun playing around with it with me and my friends. However, I have one bug (well at least I think it's one) and one suggestion:

  • The "!name" command adds a "." before and a "()" after the name entered. For instance, if I called mine "SuperBot", the end result turns out to be ".SuperBot()". Just very slightly annoying (OCD and proud, haha).
  • It would be nice if we could make the bot auto-join a voice channel automatically (with an instant invite link). Right now, the only way I can make it work without having my browser open is to open the bot's account in my browser, connect it to the desired voice channel, run the bot, play a YouTube song, and then close my browser. EDIT: Nevermind, it actually works fine. I'm just retarded. xD

Other than that, great bot! Loooots of fun with it.

Idea: Update Checker Feature?

I had an idea: an update checker for the bot. So then every time a new release is pushed to the master branch it will notify the user during the bot's startup and inform them of the update in Console. I don't know if this is possible, but I do know that it is possible to implement GitHub API in programs, so maybe this is a possibility with that API.

!youtube que

Quite simple, either have it as a option or as a command but the ability so when someone adds a youtube song that it gets add to a que because now it overrides each song.

Music player error

Hi, I'm getting this error sometimes, and when it happens it'll skip the song it is currently playing.

[tls @ 00000228e2ef6d40] Error in the pull function.
[aac @ 00000228e2f8a740] Input buffer exhausted before END element found
Error while decoding stream #0:0: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 00000228e2f0ae80] stream 0, offset 0x5740ea: partial file
"google video link" Invalid data found when processing input

another one:

[tls @ 000001619ee46f60] Error in the pull function.
[aac @ 000001619f455700] Input buffer exhausted before END element found
Error while decoding stream #0:0: Invalid data found when processing input
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001619ee5ae80] stream 0, offset 0x388076: partial file
"google video link" Invalid data found when processing input

Suggestion: Error Logging

An error log for output would be awesome. I currently am working with a few bots on the same account (Red included) and it seems to be crashing in the middle of the night, and errors are outputted to the console, but getting all the info is a pain (thanks windows). A text dump would be fantastic! Though I can see it being a lower priority.

Repeat playlist

Feature request, but i like it if i could make it play some random songs while no one suggests a youtube video, having the bit silent is sometimes a bit awkward.

So in other words, !repeatplaylist [playlist] would be cool to have it replay it a infinite time or perhaps a mode so it plays a random song from the cache once no one requested anything.

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.