Giter Club home page Giter Club logo

ratbot's People

Contributors

nlitz88 avatar

Watchers

 avatar

ratbot's Issues

Add bot status for quick information

A lot of the music bot's we've used in the past have their prefix listed in their status--ratbot should also set a status that provides a friendly summary of how to use it.

Additionally, while this is a separate issue, it'd be nice in the future to have an API in the future with a web interface that would allow the user to configure the prefix from there. OR, in the meantime, just allow them to configure it in the command line. Just some food for thought.

Add option for profanity filter

People will most likely be running this bot on a home network on some sort of VPS in their name. While it may not matter in the grand scheme of things, giving the owner the option to block song requests for inhumane YouTube content is probably a good idea. I.e., maybe add an environment variable that the owner can set that would switch on some sort of NSFW/NSFL/profanity filter for the kinds of requests that users make.

Bot doesn't add requested song using play <link> when paused

When the bot is paused and someone sends another play command (with a link or not), the bot will just resume playback. However, whether the bot is playing or not, if I send the bot a play command with a link or song name, I expect that song I just specified to be added to the queue.

While the current behavior isn't inherently wrong, it makes the bot a bit harder to use. I'd say change the behavior to always add a specified song to the queue, whether it's paused or not. Maybe use play to unpause only if the user doesn't provide a link (however, even this could be ambiguous).

OR, always use play as an unpause button like it currently is, but also enqueue the new song if one is specified! This might be the best of both worlds.

I think the most explicit, least ambiguous behavior is to just force users to user resume to unpause playback, but maybe people aren't accustomed to that.

Exception thrown when bot invoked by a user not in a voice channel

Basically, when you run a play <song> command when not connected to a voice channel, the bot doesn't respond telling you to first connect to a voice channel. Instead, it just silently fails.

On the command line, however, it does output the exception:

[2022-12-23 03:33:54] [ERROR   ] discord.ext.commands.bot: Ignoring exception in command play
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
  File "/app/music_cog.py", line 64, in play
    voice_channel = ctx.author.voice.channel
AttributeError: 'NoneType' object has no attribute 'channel'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 1349, in invoke
    await ctx.command.invoke(ctx)
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/usr/local/lib/python3.10/site-packages/discord/ext/commands/core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'channel'

Switch from streaming audio from YouTube to downloading songs

While I'm not 800% sure what the current implementation is doing, it seems like the bot is just sending over audio it's streaming from YouTube. This works okay, but after a bit of testing, it's performing very poorly. It's jitters, hesitates, and sounds pretty bad.

What I'd like to investigate is using YouTube-dl to actually download the files, store them on disk, then stream the data from file. While this may mean slightly higher response times for those with slower download speeds, the users will be able to configure an LRU (least recently used) music-cache directory. Thus, for songs that have already been selected, the request latency will be significantly reduced, as it'll forgo the download and play directly from disk.

Content rich bot responses

Here are a few improvements that would be nice to see that are featured in other bots

  1. When a song is successfully added to the queue, I'd like to see the YouTube link (embedded preview) of the song that was selected. We all know the bot is just going on YouTube and picking a video to play, so just show us what that video is.
  2. Likewise, when a song is finally played--show me the preview, maybe.

Just think about different situations where this makes sense and try to add it. I already added it for playing new songs I think.

Add a getting started section to readme

It'd be nice to have a much smaller, much more concise setup guide as a quick reference. Right now, the readme provides long-winded explanations every step of the way--but a lot of that can get lost on users (people don't like to read).

So, consider creating a smaller, more to-the-point Getting Started or Quick Start section at the top of the readme that just lists bulleted steps to getting a bot up and running, without having to understand much behind it.

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.