-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CogV2] Bot rewrite and various useful commands #1973
Merged
TheerapakG
merged 529 commits into
Just-Some-Bots:cogs-rewrite
from
TheerapakG:playground_all
Mar 14, 2020
Merged
[CogV2] Bot rewrite and various useful commands #1973
TheerapakG
merged 529 commits into
Just-Some-Bots:cogs-rewrite
from
TheerapakG:playground_all
Mar 14, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Seems that command class does not copy the alias list and removing alias outside make it unable to remove alias from parents
8 tasks
…cessed entry instead in bulk entry creation
* Add API calls to generate a web player token * Adjust Spotify implementation * Update options.ini documentation * Convert timestamp to seconds * Handle guest token failure properly
…rterduration Fix for showing negative estimated time for entries w/o duration information from ytdl
Update Dockerfile
Spotify endpoint update
amit177
approved these changes
Mar 14, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
a/backend
Affetcs the backend (youtube-dl/processing)
a/cmds
Affects the bot's commands system
a/frontend
Affects the frontend (visual appearance/ feel of the bot)
a/options
affects the bot's options system
a/permissions
Affects the bot's permissions system
a/playback
Affects the playback (ffmpeg/Discord) aspect of the bot
t/enhancement
[PRs] Someone did a thing
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After creating your pull request, tick these boxes if they are applicable to you.
review
branch (the latest developmental version)This PR does not target review branch as this is a breaking change and rhino suggested this https://discordapp.com/channels/129489631539494912/157598062020132865/633230797729562634
Description
It is kinda hard to manage all those branches and solving merge conflicts when merging them together so I just combine all these things together, for easier reviewing and creating a lot less hassle when fixing something. Nearly all of the features are completed anyway so there is no point in keeping separate branches.
This PR combines: #1938, #1917, #1916, #1915, #1904
CORE
At the core, this PR changes how the bot works to
This PR breaking change is that it changes several models related to player and playlists for ease of usage in the future; hence, data saved in the data folder will be incompatible. There are checks for the version of the data file to prevents incompatible saves but conversion script are currently NOT provided.
The player got reworked and have some states removed. Check the implementation for details.
If there is no entry in the playlist, the player would now poll the playlist at an interval for next entry rather than stopping itself.
Playlists got reworked and now do not take raw urls and make entries inside itself. It relies on entries added to it instead. It can also be named.
Playlists are now objects which are in control of caching instead and hence, can be set to cache multiple entries in the list before the player pulls it out. However, there is no option to change this from the default number (1) as of yet. Check the implementation for details.
Downloader got reworked and now uses its internal loop which it got when it is instantiated instead. Check the implementation for details.
Entries have dedicated functions to create them. Check the implementation for details.
Aliases are now being specified in .ini file so that it is uniform for all configuration files.
Due to the implementation of the cog loader (copied from my ModuBot), the run script has been modified.
UPDATING, RESTARTING AND SHUTTING DOWN
With the update command, you can now update the bot through Discord. This should reduce the pain for people who host the bot when a new update rolled out.
Restart command now reloads the bot script correctly (for the most part). Most of the updates will likely work without you needing to actually rerun the script.
Windows users can now close the bot window using the x button if they have pywin32 installed.
MULTIPLE OWNERS
You can now specify multiple users as owner to allow them to use owner-restricted commands. Just separate ids with spaces when adding them to the OwnerID config.
COGS AND MODULES (#1776 -> #1904)
Modules can be loaded dynamically. You can load modules and setting aliases for commands via commands in this category
commands in this category:
loadmodule
- load/reload specified modulecogmodule
- get module name containing the implementation of the cogadd
- group commandalias
- add an alias to the commandremove
- group commandalias
- remove an alias from the commandLOCAL FILE (#1938)
This PR allows users to queue local files, with the owner having the ability to specify which folder should be visible to the users, so that important video/audio files were not accidentally queueable.
configurations in this category:
[Locals]
AllowQueueingLocal
- determines whether queueing local files would be allowedLocalOnlySpecifiedDir
- determine whether users need to enter a full path to the local file. This could prevent someone from accidentally queueing local files.LocalDir
- limits queueing local files to these directoriescommands in this category:
lib
- List all files in the local folder which could potentially be played.PLAYLIST (#1917)
This PR allows one server to hold multiple playlists, allowing moderators to queue some stuff up for hot-swapping later when needed.
commands in this category:
playlist
- group commandlist
- list all playlists in the serverlist playlist
add
- add playlist with specified nameadd playlist
remove
- remove playlist with the specified nameremove playlist
add
- group commandentries
- group commandplaylist
- append the specified playlist's entries to targeturl
- generate a playlist from specified URL and named it as specifiedlist
- group commandentries
- list entries in the playlistqueue
remove
- group commandentry
- remove the specified entry in the specified playlistre
entries
- clear entries the specified playlistres
,clear
swap
- swap current server's playlist with the one specifiedfromfile
- generate a playlist from .txt file with the same format as _autoplaylist.txt and named it as specifiedAUTOPLAYLIST (#1727 -> #1911 -> #1917)
I realized that having one autoplaylist is not ideal for the bot that might be hosted for multiple servers. This PR allows servers to specify some of the playlists as autoplaylists, independently for each server (This also means that some entry might be a local file or even a stream).
configurations in this category:
[MusicBot]
InstaPlayIfAuto
- determine whether adding entries should skip the autoplaylistcommands in this category:
aprandom
- changes whether autoplaylist should randomize the entry.save
- add the playing song to the current autoplaylist.swapap
- swap autoplaylist to the playlist.commands removed:
resetplaylist
CAPTION (#1916)
Allows users to get the caption of the queued track (if the service have one)
configurations in this category:
[Caption]
CaptionSplitDuration
- Duration (in seconds) that the bot will consider as the beginning of a new section. Extra newline will be added between sections to improve readability.commands in this category:
caption
- get caption for the current song.captlang
- display languages that are possible to get a caption for.reloadcapt
- try to download caption for current entry again.WEBAPI (#1776 -> #1904)
This cog introduces a way for the bot to communicate with other programs (even those which are hosted elsewhere) securely, allowing us to develop other programs that utilize the bot independently (such as GUI program for managing the bot). This cog was originally meant to be a demonstration of the cog loading/unloading mechanism. This cog is disabled by default.
configurations in this category:
[WebApi]
WebApiHTTPPort
WebApiHTTPSPort
SSLCertFile
- path to ssl certificate fileSSLKeyFile
- path to ssl key fileWebApiPersistentTokens
- tokens generated (refer to commands section for how to generate it) in a session will be kept.commands in this category:
gentoken
- generate a token that will be needed for interacting via webapirevoketoken
- revoke the specified token access to the webapiOTHER SMALL FEATURES
SummonNoVoice
that allows the user with this permission to automatically summon the bot if they usedplay
orstream
but the bot is not in any voice channel. ([CogV2] playground_summonplay: Perms for automatically summoning if bot is not in vc #1915)playnext
command. (load commands as cogs, playnext, data api, and various commands #1776 -> commands as cog v2 #1904)replay
command. (commands as cog v2 #1904)setnick
now can also be invoked asset nick
setavatar
now can also be invoked asset avatar
setname
now can also be invoked asset name
(TO BE WRITTEN)
Related issues (if applicable)