mikeyaworski / utility-discord-bot Goto Github PK
View Code? Open in Web Editor NEWA Discord utility bot
A Discord utility bot
Test using GCP for hosting since the free tier + DB costs seem to be cheaper than Heroku.
Keep support for Heroku and instructions on how to host there, but add support and instructions for GCP as well.
Currently capped to 50 since searching can take a while, and the queuing process can't be cancelled.
Think of alternatives. Allow a flag to force it to use more than 50? Add an offset argument so you can queue the same playlist multiple times, but increasing the offset yourself? Or maybe something else.
Moving messages and deleting messages within threads don't work. Since the bot is not part of the thread, it seems that it can't find the messages. Perhaps an update to Discord.js is required. Should investigate this.
Editing the time, message, channel or interval
Should be able to toggle playback speed on a track being played in the player.
This will be a command that creates an alias for other commands. For example
!aliases add "moveFoobar" "move #foobar"
// now !moveFoobar some-id
// will invoke !move #foobar some-id
We can create an alias
command and a new command for handling "unknown" commands (there is a CommandInfo
option for this).
The process for invoking the aliased command is yet to be determined.
Look into this more to see if it's worth doing, or if we should just leave it to the existing bots.
/queue move <currentPosition> <newPosition>
Instead of using the message
type for start
/end
args on the delete/move commands, get the IDs as strings and use the findMessageInGuild
util to find them. This way, those commands can be used from any channel and not necessarily just the one where the message is in.
E.g.
!reminders create "August 12th at 9am, August 13th at 9am" "Some message"
Note: A comma is option for deleting multiple reminders. Whitespace is required.
!reminders delete id1, id2
!reminders delete id1 id2
Following #3, this command should be disabled by default and only the owner of a discord should be able to enable purge
.
Should be able to purge all of your own messages
Required to provide a mention of yourself to confirm that you are purging yourself (in addition to the confirmation reaction on the confirmation message)
Accept two message arguments that specify a range
Accept a channel message argument that specifies a channel to delete (in addition to the message arguments). Only the OWNER should be able to purge a channel.
Currently set to guild only.
Allow specification of time zone names like America/Los_Angeles
, PDT
, etc. And maybe even direct offsets like UTC-4
.
Create a CI check for this as well (in addition to the pre-commit hook).
Updating the command to allow !reminders ls [some-filter-string]
would be convenient. E.g.
!reminders create "30 mins" "Foo bar"
...
!reminders ls "foo"
This would list only reminders with message strings that include "foo" in them (case-insensitive). Allows you to easily find a particular reminder.
Something like:
!reminder "Dec 21st" "Do this thing"
!reminder "5 mins" "Do this thing"
!timer 5 mins
!timer "5 mins" "Some description of the timer"
In the npm start
script, use the --transpile-only
option to ignore type errors and instead run tsc
to verify them in the npm test
script.
Now that the v13 implementation won't have Commando, we will need to implement this ourselves. Store whether a command is disabled in a database.
Add a !logger
command which lets you specify certain events which should be logged to some channel. Similar to Dyno, except probably less options and mainly just focus on the ones which cannot be viewed on the Audit log.
May or may not be possible. Need to investigate.
The rollback roles functionality for streamers is partially broken. The roles which were added end up being removed during rollback, but not the converse. Removed roles do not get added back.
Will add logging to monitor the reason for this, since testing this manually is quite difficult.
For example, there is an error from the Discord API when you have more than 20 reactions on a single message. Instead of manually catching every error, handle this generically by adding the error message text to the "Something is wrong..." reply. Still handle this 20 reactions error manually as a separate condition, but add some error message text to the generic error response as well.
By providing a link or query, the bot should join VC and play it.
This should support links from Youtube, Spotify and Twitch.
Options for queue, shuffle, skip, pause, loop, etc.
Use ytdl to stream the audio.
Spotify links (e.g. playlists or specific songs) should look up the equivalent music on Youtube and play it from Youtube instead.
Context menu for things like extending rescheduling a reminder that went off, etc.
When queuing a song with /play
, add an option that specifies if the track should be inserted at the front of the queue, rather than the end.
/play youtube: ... front: True
Only members with edit permissions should be able to delete another person's reminder. Any member should be able to delete their own permissions.
Something like the Simple Poll but, but supports custom emojis for the options / reactions.
!poll "Question" ๐ "Option 1" ๐ "Option 2"
or maybe
!poll "Question" "๐ Option 1" "๐ Option 2"
and for a yes/no poll:
!poll "Question" ๐ ๐
!poll "Question"
If you move a message that's a link, like https://twitter.com/...
, it won't embed the site content since the link is posted within an embedded message by discord. See if there's a way around that.
Support Podcast episodes of the form https://open.spotify.com/episode/{episodeId}
(or a collection of episodes with https://open.spotify.com/show/{showId}
).
These are apparently streamable through youtube-dl, but if not, then this might not be possible.
/play spotify:... shuffle: True
And if shuffle is already enabled, should queue them in shuffled order right off the bat.
It properly handles events when streamers go live, but when they stop streaming, it doesn't seem to trigger the event, or the event handler is not working.
Mainly just add in jest
and configs for that to run (add them to the npm test
script as well). Create some example unit tests on our src/utils
file.
The database column is using a 255 length VARCHAR, but this should be extended to the max length of a discord message, which is around 4000 characters.
Could also use Sequelize.TEXT
instead, and send the reminder in multiple messages if it exceeds 4000.
If you reply to a message with !mv #some-channel
, see if it's possible to move the message you're replying to, to the channel.
!enable <command>
or !disable <command>
should store a flag in some database table (associated with the guild) that enables some command. For example, !purge
should be disabled by default (for safety), but can be enabled by an owner. Each command in our code should specify if the command is able to be toggled and who can toggle it (e.g. owner only, administrator, someone with MANAGE_MESSAGES
permission, etc.).
Similar to reaction roles, but when you react to something, give your nickname some prefix which indicates your activity (or maybe a custom activity).
!reaction-names add [Eating] ๐
And then it turns your nickname from mike
to [Eating] mike
.
There is a TODO comment in the code.
Currently, if the message range exceeds our limit of 100 messages per request, we will just truncate it at 100. Instead, we should chunk the requests into groups of 100 and make multiple requests.
Probably just fetch the equivalent videos on YouTube and play those.
Allow users to add base roles that every member should get upon joining the discord (with optional timeout before getting it assigned).
Something like:
!base-roles <add | remove | list | clear> [role] [timeout in seconds or string form]
!base-roles add @some-role
!base-roles add @some-role "10 minutes"
!base-roles add @some-role 600
Allow player commands to be locked behind one or more roles, if a guild chooses to configure it that way.
/player-roles add @Role
/player-roles remove @Role
/player-roles clear
There are some necessary things in v13 such as endpoints for searching threads, and the ability to use slash commands.
discord.js is not supporting their Commando framework anymore, so we will need to either:
v13 introduced message buttons, so utilize them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.