// click here to go to my website!
window.location.replace(`https://jackdotjs.github.io/`)
jackdotjs / optibot Goto Github PK
View Code? Open in Web Editor NEW(DISCONTINUED) The original Discord bot for OptiFine. https://discord.gg/3mMpcwW
(DISCONTINUED) The original Discord bot for OptiFine. https://discord.gg/3mMpcwW
This is just to help prevent potential ratelimiting.
Need this to avoid ratelimiting and general better practice. Might also prove to be slightly faster.
OptiBot should also automatically update this cache when a message is posted/deleted/edited in the FAQ channel.
!debug
Need this now since Builder posted that long Q&A for OptiFine installation.
Could probably cut the message down and make a sort of "preview", along with a message saying "this answer is too long" or something.
Side note: This is a pretty old issue at this point, 4 months and going. With the newest versions of OptiBot, I am not entirely sure if this is relevant anymore. Still, this was a pretty large issue at one point, and I'd like to keep it here just incase something ever comes up again.
Stack trace:
events.js:173
throw err; // Unhandled 'error' event
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
at Client.emit (events.js:171:17)
at WebSocketConnection.onError (C:\Users\Administrator\Desktop\DISCBOT_GIT\optibot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:374:17)
at WebSocket.onError (C:\Users\Administrator\Desktop\DISCBOT_GIT\optibot\node_modules\ws\lib\event-target.js:128:16)
at WebSocket.emit (events.js:182:13)
at _receiver.cleanup (C:\Users\Administrator\Desktop\DISCBOT_GIT\optibot\node_modules\ws\lib\websocket.js:211:14)
at Receiver.cleanup (C:\Users\Administrator\Desktop\DISCBOT_GIT\optibot\node_modules\ws\lib\receiver.js:557:13)
at WebSocket.finalize (C:\Users\Administrator\Desktop\DISCBOT_GIT\optibot\node_modules\ws\lib\websocket.js:206:20)
at TLSSocket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
Old comments:
April 6, 2019 - I've added some tests for this issue. Just gotta wait for something to go wrong now, I guess.
April 9, 2019 - OptiBot got stuck in a boot loop today after encountering this error. if there were any higher priority levels, id add them at this point. I've added more try/catch blocks in an attempt to get a useful log for this error.
May 25, 2019 - This may have been somehow fixed just by adding those try/catch blocks. I haven't found any relevant error log since adding them, and this issue seems to have simply disappeared. I have absolutely no idea what's going on anymore. I might go through and check ALL the logs on the server later just to be sure.
need this because the SMR repo doesnt seem to be updated very often
Just a little QOL thing to fix all icons having to download every time.
String similarity does not work correctly for single characters (m, h, d). Need to create a special function in these cases.
Alternatively, maybe a shorthand alias which will match better with the original array?
!motd [message]
!clearmotd
?), and using the blank MOTD command to preview the existing one.Title.
!list
.May involve emoji reactions on a message in the #rules channel.
Maybe add a time limit to prevent near instant reactions?
Adds an @mention for verified cape owners that are on the server.
This requires manual verification in the same sense as adding roles to users.
!cv <user> <minecraft username>
!uncv <user>
!links
?Usage: !status [group]
!status optifine
- Shows OptiFine servers. (defaults to this if no group is specified)
!status minecraft
/ !status mojang
- Show Mojang servers.
!status all
- Current function, shows all servers at once.
OptiBot's currently loader is... for all intents and purposes, pretty awful. It desperately needs reorganization, cleanup, and general optimization.
While working on this, I believe it could open an opportunity to finally bring back remote updates. Will need to see how to make this work better than before, though.
!server [query]
(might need a different name to avoid confusion with !servers
)me
- specifies the user that invoked the command
Because why not.
!stats
messages received
commands received
bot messages sent
total kick count
total ban count
total mute count
users joined
users left
join/leave ratio
...
(not sure what else to add here)
A majority of log files will go unused/ignored, and eventually I just end up deleting them anyway. With the introduction of #41, and the fact that we have very limited capacity on the AWS server, I think it'd be in best interest to automatically remove old log files automatically.
relevant docs, needed to check age of files
Just a plain UX thing
This will be somewhat complicated as the websocket event does not provide useful information. May need to cache every pinned message in working memory.
Should make for some easier indexing.
Update: Here's a concept layout:
{
"member_id": "181214529340833792",
"cape": {
"uuid": "891d59a8e0184030944b3345342a0189"
},
"medals": {
"count": 0,
"msgs": []
},
"warnings": [
{
"expiration": 0,
"executor": "181214529340833792"
}
],
"mute": {
"status": 0,
"expiration": 0,
"executor": "181214529340833792"
}
}
Notes:
mute.status
, 0 = no mute, 1 = mute with time limit, and 2 = mute forever.mute.expiration
is a date timestamp.warnings
is an array of objects. Each object contains an expiration date timestamp and the ID of the moderator who gave the warning. (see #10 for details)!ask (?)
!faq (?)
!jarfix
!tm
!1710 or !agemc (#25) (?)
!lock
(?)
- not sure if this needs a custom icon/not yet sure what this icon could be
Normally, the entry would be removed at the end of the time limit regardless of the user being in the server or not. This would simply help to further clean up the muted user database, especially in the case of users that are muted forever.
This has to do with the new logic for logging deleted messages. Should be a relatively simple fix.
!agemc <version>
!faq [query]
!warn <user>
-Builderb0y, 2019
Regex:
/\bMC-\d+\b/gmi
Mojangs issue tracker site is incredibly strange, and there's no API for it from what I can tell. I'm not entirely sure if this is really do-able anymore.
!award <user>
Use arrow shortcut from findTargetUser handler to find message attachments in the previous message.
!dice <width> <height>
This is primarily for usage in CTM creation.
As requested by @Hax4Ever
Usage: !medals [user]
Uses targetUser handler.
This command simply pings all users with a specific new role. (see sp614x/optifine#2677 )
Interesting thing I came across tonight. Just something that may be worth looking into sometime.
https://discordjs.guide/popular-topics/reactions.html#listening-for-reactions-on-old-messages
https://gist.github.com/Lewdcario/52e1c66433c994c5c3c272284b9ab29c
https://gist.github.com/Danktuary/27b3cef7ef6c42e2d3f5aff4779db8ba
Need to remove this message spacer that most entries have:
_ _
!tban <user>
Split the !docs
command into two commands:
Usage: !docs [query]
This command searches for a "category" of files for OptiFine documentation, and uses the official names of OptiFine features rather than the file names in the legacy !docs
command.
There is no easy way for OptiBot to automatically group files together, so this have to be done manually. This is not entirely ideal, as documentation files will occasionally be updated and added. When a file is missing, users could alternatively use the legacy command:
Usage: !docfile [query]
This is essentially the "legacy" form of the !docs
command, where it searches for individual files on OptiFine documentation.
!assist [page #]
Just a general improvement.
Essentially allows for dynamic coloring of icons. Could be used in error messages specific to individual commands.
August 5, 2019 - I experimented with this idea today, it turns out trying to implement this with the way icons are loaded is basically impossible. OptiBot will need use callbacks to be able to load composite icons before sending embed messages.
This will be a lot more difficult to implement than I initially thought. While entirely possible, it'll get pretty messy and I'm not yet sure if it's worth the hassle.
This is related to the !open
and !close
commands that currently do nothing right now.
OptiBot currently only has permissions to do this for the #feedback channel, but I believe this should be made to be expanded upon in the future. It could probably even be used to make a full-on lockdown feature.
For now though, I need to figure out how to make this work for just one channel. Sounds difficult enough. First problem is trying to save the existing permissions set up, and then replace them with our own when the channel is "closed"
Displays time limits for mute on a user's profile, assuming they've been muted.
Ancient text:
!chkmute <user>
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.