109 Commits

Author SHA1 Message Date
Michael H
6075c5bde0
Rename bot.db as bot._config (#2967)
* Rename `bot.db` as `bot._config`

  - Continues work towards strong version guarantees
  - Added methods for cog use for a few things which were previously
  only accessible via direct access.
  - Retained private use in a few internal use locations, though most
  methods were updated away from this.
  - Updated documentation for shared api token users

* changelog

* more detail

* docstring fixes

* Apparently, I forgot to commit something I had locally

  - + a copy/paste failue in the changelog

* *sigh*:

* *sigh*
2019-09-01 15:42:28 -04:00
Draper
3c1b6ae4cf [Utils] Add humanize_number() function to chat formatting (#2836)
This adds babel as a dependency, and also includes `redbot.core.i18n.get_babel_locale()`
2019-08-28 08:44:52 +10:00
PredaaA
3498f8ccb6 Remove commas for explanations about how to set API keys (#2905)
This removes commas in explanations about how to set API keys in streams, image and audio cogs, since it has been changed in #2692.
2019-08-18 09:50:48 +10:00
aikaterna
be184b57dd [Audio] Update equalizer permissions (#2813)
* [Audio] Update equalizer permissions

* Reformat header on eq list for i18n

* Style
2019-07-13 20:48:13 -04:00
aikaterna
55ff9bedb7 [Audio] Check for player when not connected (#2842) 2019-07-08 13:17:50 +10:00
aikaterna
d1593b8069 [Audio] Catch unhandled internal folder types (#2824)
The `folder:` and `localfolder:` prefixes are used internally with some localtracks strings to define what to do with the item when it's cycled through the search function. Users theoretically should have never seen this issue as [p]search is used on the user side for YouTube and Soundcloud searching and not local searching, but this handles the issue where a folder is being passed to these functions that doesn't exist.
2019-07-02 13:15:34 +10:00
aikaterna
93391d028c [Audio] _enqueue_tracks clarification/fix (#2822)
Resolves #2820.

Added some comments to clear up a little of the mystery in a couple places.
2019-07-02 13:11:44 +10:00
PredaaA
2f8b1a21c7 [Audio] Fix config set in shuffle and repeat commands (#2812)
Resolves #2811 and also the same thing in repeat command.
2019-06-30 01:28:29 +10:00
aikaterna
d1d4ec3e38 [Audio] No capitalization needed (#2801) 2019-06-27 08:13:01 -04:00
aikaterna
a0f34bbbd9 [Audio] Move DJ role check in [p]summon (#2799) 2019-06-27 10:48:06 +10:00
aikaterna
870b615364 [Audio] Queue & misc cleanup (#2784)
* [Audio] Queue & misc cleanup
2019-06-24 01:09:04 -04:00
aikaterna
25ccc11dc4 [Audio] Add [p]summon (#2786) 2019-06-24 01:05:01 -04:00
aikaterna
f2b7ce9546 [Audio] Add equalizer (#2787)
* [Audio] Add equalizer

* [Audio] Add equalizer
2019-06-24 00:58:20 -04:00
DiscordLiz
6bdc9606f6 [Core] Multiple mod admin roles (#2783)
* Adds Schema versioning
  - Adds Migration tool
  - Adds tool to migrate to allow multiple admin and mod roles
  - Supports Multiple mod and admin roles

* Ensures migration is run prior to cog load and connection to discord

* Updates to not rely on singular mod/admin role id

* Update requires logic for multiple mod/admin roles

* Add new commands for managing mod/admin roles

* Feedback

Update strings
Update docstrings
Add aliases

* Use snowflakelist

* paginate

* Change variable name

* Fix mistake

* handle settings view fix

* Fix name error

* I'm bad at Ux

* style fix
2019-06-23 23:36:00 -04:00
Toby Harradine
1804314f45
[Audio] Improve Lavalink download/connection exception handling (#2764)
- More errors will be logged to the console with clearer messages when something goes wrong
- Downloading the Lavalink Jar will abort after 5 failed attempts. The connect task will also abort if an unhandled exception occurs whilst downloading or connecting to Lavalink. After this occurs, instead of responding "Connection to Lavalink has not yet been established" to commands, the bot will respond "Connection to Lavalink has failed". This has no effect on other commands which don't involve connecting to Lavalink (e.g. settings commands).
- Logs this message when Lavalink jar is successfully downloaded: `Successfully downloaded Lavalink.jar (<x> bytes written)`
- Uses [`tqdm`](https://github.com/tqdm/tqdm/) to display a progress bar whilst downloading Lavalink.jar.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-06-23 14:09:59 +10:00
aikaterna
e854716236 [Audio] Fix for escape character prefixes (#2789) 2019-06-21 22:19:57 -04:00
aikaterna
c2195ec576 [Audio] Add bot permission checks (#2756) 2019-06-02 18:55:44 -04:00
Flame442
132545e057 [Audio] Clarity changes for the API info commands (#2733)
* Clarity changes for the API info commands

* Remove unnecessary f-string
2019-05-27 20:27:56 -04:00
NIXC
96a91b9d0e [Audio] Add ability to skip to a specified track by number (#2584)
* add skip to track functionality

* formatting

* Change some strings

* missing return, variable naming

* add variable names for translations

* change handling of skipping 1 track

* minor semantic adjustments

skiptotrack -> skip_to_track
2019-05-08 01:34:37 -04:00
aikaterna
65b88c09fb [Audio] Update for Red-Lavalink 0.3.x (#2547)
* [Audio] Update for Red-Lavalink #55

* Update setup.cfg

* Catch all the exceptions

* Update version range on Red-Lavalink

* Catch excepts on Spotify tracks/playlist upload

* No prefix needed
2019-05-08 00:56:40 -04:00
Will
bb6327d969
[Audio] Fix architecture blacklisting (#2634) 2019-04-30 12:32:16 -04:00
Toby Harradine
476f441c9b [Audio] Refactor internal Lavalink server management (#2495)
* Refactor internal Lavalink server management

Killing many birds with one stone here.
- Made server manager into class-based API with two public methods: `start()` and `shutdown()`. Must be re-instantiated each time it is restarted.
- Using V3 universal Lavalink.jar hosted on Cog-Creators/Lavalink-Jars repository.
- Uses output of `java -jar Lavalink.jar --version` to check if a new jar needs to be downloaded.
- `ServerManager.start()` won't return until server is ready, i.e. when "Started Launcher in X seconds" message is printed to STDOUT.
- `shlex.quote()` is used so spaces in path to Lavalink.jar don't cause issues.
- Enabling external Lavalink will cause internal server to be terminated.
- Disabling internal Lavalink will no longer reset settings in config - instead, hard-coded values will be used when connecting to an internal server.
- Internal server will now run both WS and REST servers on port 2333, meaning one less port will need to be taken up.
- Now using `asyncio.subprocess` module so waiting on and reading from subprocesses can be done asynchronously.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Don't use shlex.quote on Windows

Signed-off-by: Toby <tobyharradine@gmail.com>

* Don't use shlex.quote at all

I misread a note in the python docs and assumed it was best to use it. Turns out the note only applies to `asyncio.create_subprocess_shell`.

Signed-off-by: Toby <tobyharradine@gmail.com>

* Missed the port on the rebase

* Ignore invalid architectures and inform users when commands are used.

* Style fix
2019-04-29 21:31:28 -04:00
aikaterna
c1bee3fee5 [V3 Audio] Add settable path for external Lavalink (#2480) 2019-04-29 18:34:09 -04:00
aikaterna
d786103d8d [Audio] Set cwd for localtracks on playlist start (#2534) 2019-04-29 18:28:44 -04:00
Michael H
ad114295e7
Discord.py dep update 3.1 (#2587)
* Dependency update

discord.py==1.0.1
websockets<7

[style]
black==19.3b0

[Docs]
jinja==2.10.1
urllib3==1.24.2

Changes related to breaking changes from discord.py have also been made
to match

As of this commit, help formatter is back to discord.py's default
2019-04-23 21:40:38 -04:00
aikaterna
0ff7259bc3 [Audio] DJ role should ask for a role (#2606) 2019-04-23 18:41:46 -04:00
zephyrkul
ee11d7da63 [V3 Audio] Cancel emptydisconnect when no longer alone (#2519)
* [audio] cancel disconnect when no longer alone

* [audio] fix modifying while iterating
2019-04-22 20:05:37 -04:00
aikaterna
005123a371 [Audio] Fix for playlist queue when not playing (#2586) 2019-04-22 19:17:44 -04:00
aikaterna
bb8ce43cc0 [Audio] Track search and append fixes (#2591)
* [Audio] Track search and append fixes

* Appeasing the style gods
2019-04-22 19:17:17 -04:00
PredaaA
ad06b0e723 [Audio] Fix issue on audiostats command when more than 20 servers to display (#2533)
* Update audio.py

* Fix of pages counter.
2019-04-18 12:12:16 -04:00
jack1142
e347ffa336 Bot can join voice channel with user limit if it has move members perm (#2525) 2019-04-09 20:33:19 -04:00
aikaterna
39b64b7570 [Audio] Fix for localtrack playing (#2557) 2019-04-09 17:13:57 -04:00
aikaterna
56b220b92e [Audio] Fix for prev command display (#2556) 2019-04-09 17:10:25 -04:00
aikaterna
de7d08ee75 [Audio] Match v2 behavior for channel change (#2521)
* [Audio] Match v2 behavior for channel change

* Use move_to instead of connect
2019-04-02 22:22:57 -04:00
aikaterna
2a486cad66 [V3 Audio] Playlist info improvements (#2274)
* [V3 Audio] Playlist info improvements

* Add pagify import, reformat for Black

* Change from code block to embed with links
2019-04-02 21:48:21 -04:00
aikaterna
80fc639480 [V3 Audio] Queue clean and queue clear addition (#2476)
* [V3 Audio] Queue clean and queue clear addition

* Use DJ role and existing checks inst. of mod/admin

* Remove unneeded .format()
2019-04-02 21:12:55 -04:00
aikaterna
050300040c [V3 Audio] Add Spotify support (#2328)
* [V3 Audio] Add Spotify support

* [V3 Audio] Update LICENSE

* Appeasing the style gods

* Extra word removal on LICENSE

* Update for #2389

Thanks to TrustyJAID for the help.

* Playlist command support for Spotify URLs or codes

* Add exception for dc while loading Spotify tracks

* Allow Spotify urls by default in audioset restrict

Matches the behavior of Spotify codes already being allowed by default.

* Update audio.py

* .format() moving

* Added a character to try to make Travis behave
2019-03-28 13:41:17 -04:00
aikaterna
94c3a2fedd [Audio] Seek command can now seek to position (#2470)
- Seek can now seek to a specific position, formatted like 00:00:00 or 00:00. Using negative or positive ints still functions the same as previously and will seek ahead or behind by that value instead.
- This PR requires the `_time_convert` func added in #2465 and should be merged after that one.
2019-03-10 18:27:23 +11:00
aikaterna
421043d923 [Audio] Fix for audioset status (#2481)
Revert player.is_playing check added to the playing players list for audioset status in #2473. This addition would cause no status to be shown when a local track was played and skip was used.
2019-03-08 09:09:22 +11:00
aikaterna
1c22b212c2 [Audio] Add songs when search-queuing (#2513)
Searching for a song and pressing the reaction to queue a song would not add the song to the queue if `[p]audioset maxlength` was off. This was an omission from #2465.
2019-03-07 14:12:15 +11:00
aikaterna
15037013e7 [Audio] Add option for dc at queue end (#2472)
This addition adds a toggle for having the bot instantly disconnect when the queue ends. It takes precedence over the `[p]audioset emptydisconnect` setting as it disconnects immediately when the queue or single song is finished.
2019-03-04 14:16:26 +11:00
Toby Harradine
628073cbe1
Update Translations (#2486)
Also included a Makefile recipe which makes use of the Crowdin CLI's `crowdin download` command. This requires whoever is using it to provide the project's API key in an environment variable, but we may automate this at some point.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-03-04 08:55:01 +11:00
aikaterna
2755592175 [Audio] Playlist download addition (#2482)
Bot owners can use `[p]playlist download playlistname` to download a playlist file that is compatible with the playlist upload command. Songs can also be exported for v2 use by using `[p]playlist download playlistname True`, which strips out tracks besides YouTube or Soundcloud URLs.
2019-03-03 14:29:42 +11:00
El Laggron
46f9cae0ef [Audio] Sort local files (#2358) 2019-02-27 16:22:10 +11:00
aikaterna
b0ab6bd7e2 [Audio] Add track length restriction (#2465)
* Added `[p]audioset maxlength`, which takes seconds or 00:00-style of formatted input for restricting the player to songs that have a length under that threshold.
2019-02-24 11:44:58 +11:00
aikaterna
7b9d85c1b5 [Audio] Emptydisconnect and status refactor (#2473)
- Refactored disconnect_timer, the function behind audioset emptydisconnect, to be more appropriately responsive (thanks to TrustyJAID)
- Refactored status clearing/status changing when emptydisconnect or other Lavalink player statuses would have a TRACK_END event but no QUEUE_END event. This should clear or modify the bot's status event appropriately when [p]audioset status is on and the bot disconnects due to emptydisconnect and ideally play a little nicer with other cogs that set statuses.
2019-02-23 08:45:01 +11:00
aikaterna
16bb334fba [Audio] Add playlist copy (#2205)
Bot owners can now copy playlists from one server to another using server IDs.
2019-02-19 10:36:20 +11:00
aikaterna
7e2e37ab3f [Audio] Play local folders via text command (#2457)
`[p]local folder` will now accept folder names in the command instead of having to navigate through the reaction menu. Also added an alias of `[p]local start` to help users coming from v2 audio.
2019-02-19 10:16:41 +11:00
aikaterna
83411d0fa4 [Audio] Change pause to a toggle (#2461) 2019-02-19 10:10:11 +11:00
aikaterna
d608dd953b [Audio] Remove aliases (#2462) 2019-02-19 10:08:59 +11:00