java-discord / javabot Goto Github PK
View Code? Open in Web Editor NEWGeneral utility bot for the Discord Java Community
Home Page: https://discordjug.net/
License: GNU General Public License v3.0
General utility bot for the Discord Java Community
Home Page: https://discordjug.net/
License: GNU General Public License v3.0
Description
Allow inlining of code blocks from GitHub links that have highlighted lines.Example
Dioxin says:
Check this out:
https://gist.github.com/discorddioxin/27a33cf1376847f4ada29d61390c5198#file-main-java-L13-L16Bot says:
box.getItems().add(new Student("First", 111, 3)); box.getItems().add(new Student("Second", 222, 4)); box.getSelectionModel().select(0);
→ https://canary.discord.com/channels/648956210850299986/752535909228085348/867505817506414593
Describe the bug
Whenever a message in a text channel gets a sufficient amount of stars, the bot posts it in the starboard channel.
This does not happen if the message is sent in a thread.
Steps to reproduce
Expected behavior
The message should be copied to the starboard channel
Additional context
https://canary.discord.com/channels/648956210850299986/934397458434387969
I've noticed that Threads that are deleted via the Submission Controls System don't get marked as 'reviewed'. Thus, users cannot create another submission for the following week. This needs to be fixed.
When using the /regex command with some regex patterns the bot stops responding to any other commands and starts missing heartbeats. This happens because the pattern the user put it takes a very long time to calculate which in turn hangs the bot.
Add the question's text and the review date to the private threads starter message.
Add some instructions so users don't end up submitting only 3 words.
No response is sent to the user when a new jam is successfully created.
Currently, if the owner of a help channel uses the /unreserve command but doesn't answer the "Who do you want to thank" question the channel is considered as reserved and only unreserves after the normal timeout - this should be changed so it closes them faster if someone uses /unreserve but doesn't continue.
make the bot to add a
:star:
reaction in #⭐︱starboard as well and the star count to be the sum of stars on the original message and on the message in #⭐︱starboard. It's kinda awkward to have to jump to the original message to star it
→ https://canary.discord.com/channels/648956210850299986/752535909228085348/867505817506414593
The Antiraid feature is currently using MongoDB to store a list of potential bots.
We could improve antiraid by removing the database usage altogether
I've notived that paths like other.roles.admin_rid
don't work with Database#queryConfig
Currently, /format-code always formats the LAST message, even if it's sent by the bot itself. This is unnecessary and not what people expect
I've noticed that the bot takes a long time to fully start up because it is slowly updating commands and privileges. Can we make it so that it doesn't do this by default, but only if we, for example, add an argument to the command line or do something in discord to trigger it?
Or even better, find some generic way to update the privileges of only a selected list of commands, but not all.
I'm getting the following exception when I add reactions to a message, while I was working on the java jam stuff:
java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsJsonObject()" because the return value of "com.google.gson.JsonObject.get(String)" is null
at com.javadiscord.javabot.other.Database.getConfigString(Database.java:227)
at com.javadiscord.javabot.events.StarboardListener.onGuildMessageReactionAdd(StarboardListener.java:298)
I've noticed that modifying the state of submission threads via the /qotw submission
command is not working like intended.
The server is growing really fast, and we're gonna reach a point where we will really need to add more moderators and staff to help out. So I think it would be nice to add a /staff-apply
command that users could use to apply to different staff roles.
Here's a list of the data which is collected on our current airtable form:
By doing it via slash commands, we can reduce this down to just the following fields:
ROLE
option)And then, the benefit is that we can view applications and accept/reject them automatically within Discord, and the bot can then automatically apply the necessary roles and send any welcome messages we'd want.
/staff-apply <name> <age> <email> <timezone> <rank> <remarks>
/staff-applications list [page=0]
, reject applications with /staff-applications reject <id> <reason>
, or accept applications with /staff-applications accept <id>
."Staff applications aren't needed at the moment"
message or something of that nature.The Java Bot should notify you via private message if a transaction occurs on your account. This should be on by default for every user, but each user should be able to opt-out of it. The opt-out functionality involves updating the schema to include a user preferences table.
Something like this:
CREATE TABLE economy_account_preferences (
user_id BIGINT PRIMARY KEY,
receive_transaction_dms BOOLEAN NOT NULL DEFAULT TRUE
# Add other preferences here later.
);
Essentially, add the exact same thing /format-code does, but as a message context menu.
Add a possibility for the Community to remove stuff from share-knowledge (voting etc)
https://canary.discord.com/channels/648956210850299986/752535909228085348/891740402116358224
Add Some Kind Of Currency Exchange
We Currently Have Few /economy commands but are not in use so i would suggest to implement something which will allow people to earn currency with/without participation (for ex:- help, qotw, jams)
Suggstions
staff can monitor people can reward them if they deserve it
people who contribute can earn fixed amount of salary each week
We already have /economy account
and /economy send
, but it would be useful to find a nice way for server members to earn credits by doing small tasks in the server, so that these credits can actually be used.
Here are some suggestions:
When a user sends a suspicious link (such as phishing urls) the link gets deleted by automod, but if the same link in sent in #Suggestions SuggestionListener does no find anything wrong and posts it as an embed
To reproduce the same issue simply share a suspicious url in #suggestions and see the magic
Its expected for suggestion listener to delete the message rather then reposting it
Currently, it's not very easy to update the bot's SQL schema which is used for strictly-typed relational data. This should be made simpler so that newer releases can update the schema without having to manually open a command-line connection to the database.
I have a few ideas for how this can be done:
I'm leaning towards the second option, but in both cases this involves first making a migration
table in the database to ensure that we don't try to run a migration that has already been run.
CREATE TABLE migration (
name VARCHAR(255) PRIMARY KEY,
created_at TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
script_hash VARCHAR(1024) NOT NULL,
performed_at TIMESTAMP(0),
performed_by BIGINT,
successful BOOLEAN
);
As mentioned by dan1st, we should require that users read through the help guidelines before allowing them to ask a question in one of the help channels. We can do this by requiring users to react to a message in Help-Guidelines (or possibly other places as well), before being able to send messages or create threads in the help channels.
Once a user does the required actions, the should be given a role that permits them to use the help channels.
Add a /redeploy
command, or something of that nature, which would automatically fetch the latest version of the bot's source from GitHub, compile it, and restart the bot using the new version.
As this was a feature we were planning to implement in the now scrapped JavaBot2, I added it here.
We should prevent users from using the help system unless they have passed a test indicating that they have read and understood the help guidelines and some basics of how to ask good questions.
Dan suggested that such a test should include the following:
I suggest that we implement such a test in the following way:
I've noticed that it's kinda hard to know what preferences you can edit.
I think that a choice option type would fit better than a string input.
To stop people from spamming the @help-ping role we should add a cooldown to the command.
I think this should be a per-person cooldown and not server-wide as the number of open questions highly fluctuates.
Pleezon suggested a feature that allows people to use a slash command that takes a regex pattern and a string and checks whether the string matches the pattern (https://canary.discord.com/channels/648956210850299986/752535909228085348/920221971545989120)
e.g. and probably most important for now links looking like discord.com that aren't real
Could also include a general list of known phishing links
The current one was meant as a proof of concept, the code is ugly (and hardcoded to the channel IDs)
OR: just code CommuntiyJam into @java
We should use @ mentions instead of raw usernames for the thanks-leaderboard
As the quality of posts in the looking-for-programmers channel is very low, we should make creating posts in there only possible using a modal interaction with some basic information.
As suggested by Dioxin, we should add the jam end date to /jam info
. Only thing is, currently the schema for the jam is defined as:
CREATE TABLE jam (
id BIGINT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(64) NULL DEFAULT NULL,
guild_id BIGINT NOT NULL,
started_by BIGINT NOT NULL,
created_at TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
starts_at DATE NOT NULL COMMENT 'Official start date of the jam. Usually the start of the month.',
completed BOOLEAN NOT NULL DEFAULT FALSE,
current_phase VARCHAR(64) NULL DEFAULT 'Theme Planning' REFERENCES jam_phase(name)
ON UPDATE CASCADE ON DELETE SET NULL
);
The entire Jam operation is currently manually operated via /jam-admin next-phase
, and I think this should still be the case to account for any unforeseen circumstances, so I would suggest doing a schema migration with:
ALTER TABLE jam
ADD COLUMN ends_at DATE NULL DEFAULT NULL AFTER starts_at;
And with this, comes the necessary requirement to be able to edit certain Jam properties, so we should also consider adding a /jam-admin edit <property-name> <value>
command.
In the future I do want to add some sort of scheduler (probably Quartz) to handle automatically updating the jam phase, and other regularly scheduled tasks, but for now this should remain manual.
Consider adding bot-managed help channels to streamline people's questions and answers.
There are several open help channels that are clearly visible. Users are directed to ask their question in one of these channels.
Once the user sends their first message in an open channel, the channel is moved to a separate area for "active questions". It will stay open in a "pending answer" state until another user (not the original question asker) sends a message in the channel, as a response to the question. If no response is given after X hours, the bot sends a message in the channel to ask the user to confirm that the question is still unanswered, and the channel will stay reserved. Repeat this confirmation flow as long as possible (or introduce a hard cutoff limit).
Once some discussion has happened in a reserved help channel, and the user has obtained their answer, the bot will wait for at least X minutes of inactivity, after which it will send a question to the user in the channel, asking if their question was successfully resolved. If they respond affirmatively, the channel is moved back to the list of available channels, or if not, it stays "reserved".
Right now, it is possible to issue commands like /ban
or /warn
on yourself. This should be fixed
Each time a user affirms that their help channel is still in use, the time until the next activity check should increase a bit.
For example: Bob reserves his channel for a question, but nobody answers after 30 minutes, so he's prompted with the activity check message from the bot. He affirms that he's still using it, so the bot checks again in 60 minutes. Again he affirms that he's still using it, so the bot checks again in 2 hours.
This should add a configurable factor
by which the amount of time the bot waits between each successive activity check increases, in case the reserving user has affirmed that they're still using the channel.
This should also add a configurable maximum wait time, after which the wait time cannot increase further.
https://canary.discord.com/channels/648956210850299986/752535909228085348/860302029199900702
Possibly change the automod (that handles too many files) so it doesn't trigger (as fast) with java source files or at least inform the user before muting
I've noticed that, especially on the Java Discord, it really takes some time for the bot to loop through all Starboard Messages and update them.
A way to queue up QOTW's, so I don't end up forgetting them every single time. :^)
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.