jstnmcbrd / discord-delphi Goto Github PK
View Code? Open in Web Editor NEWEthics bot for Discord
Ethics bot for Discord
The replaceUnknownEmojis
method is supposed to take custom Discord emojis (which are enclosed with semicolons and contain letters, underscores, and hyphens) and replace them with the name of the emoji, surrounded by asterisks.
Ex: :fight_me:
-> *fight me*
However, this method doesn't differentiate between semicolons and underscores used for custom emojis, and those just used normally. It replaces every semicolon with an asterisk, and every underscore with a space. I should refactor this method to use regex to parse the input and only replace special characters used for custom emojis.
On a related note, it also forgets to replace hyphens with spaces.
(Duplicate issue with JstnMcBrd/Discord-Cleverbot#17)
Instead of a makeshift "Listening to /help" or "Watching for /help" activity, have the bot set a custom activity that just says "Use /help", maybe with an emoji.
Duplicate issue with JstnMcBrd/discord-cleverbot#13
For some reason, the user activity of this bot is no longer being set correctly. Instead of saying "Listening to /help", the activity is now empty.
No packages were updated, and no code was changed. Restarting the bot did not help. The bot should automatically set the activity every 5 minutes to prevent it from expiring, but that's not working either.
To fix this issue, I will try updating discord.js.
Duplicate issue with JstnMcBrd/Discord-Cleverbot#12
The colors node module adds special formatting to output text so the Windows console knows to color the text. However, this does not work in Linux. Instead, all the output text has weird characters before and after each string that makes the output log really hard to read.
To fix this issue, the colored text feature should be disabled when running on the web server.
After being set, the user activity will occasionally disappear, requiring the activity to be set again.
This is a known problem with the discord backend. See discord/discord-api-docs#834
A workaround for this problem has already been implemented. I am simply creating (and closing) this issue so I have a reference for the bug and I can link it to the original issue in the discord-api-docs.
If the discord backend is ever fixed, I can remove the refreshing system in the activity manager.
Duplicate issue with JstnMcBrd/discord-cleverbot#42
Create a "validate" workflow that will lint, run unit tests, and build whenever a new PR is created.
Linters help programmers create consistently formatted code that conforms to good standards. Setting one up would help make this project cleaner and ensure future code quality.
There doesn't appear to be a way to check what the client's current activity is, which prevents the bot from testing whether client.user.setActivity()
was successful. Instead, the presence it tests will always contain the inputted activity, whether or not the activity actually updated server-side.
Both the return value of ClientUser.setActivity()
and the property of ClientUser.presence
are simply set to whatever the latest presence passed through setActivity()
was, even if it fails to update on Discord.
Duplicate issue with JstnMcBrd/discord-cleverbot#3
See feature request discordjs/discord.js#10206
TypeScript is widely considered a more reliable and responsible way to code in JavaScript. It would take a lot of work, but migrating this project would keep it up to modern standards and pay big dividends in the future.
When a user sends the bot an empty message, the bot tries to fetch an improperly formatted API request, which throws a 400 Bad Request error.
There should be a default input for the API request in case the users sends an empty message.
The bot's slash commands don't need to be re-registered every time it starts. The discord.js user guide recommends having a separate script that you run any time you update the commands.
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.