-
-
Notifications
You must be signed in to change notification settings - Fork 101
Migrate free channel command #221
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
Migrate free channel command #221
Conversation
This will work similar to the current free channel system right? |
no, this will not work by typing in |
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelStatus.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/UserStrings.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/config/FreeCommandConfig.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/UserStrings.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/Util.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/config/FreeCommandConfig.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/config/FreeCommandConfig.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/config/FreeCommandConfig.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/config/FreeCommandConfig.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/config/FreeCommandConfig.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/config/FreeCommandConfig.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelStatusType.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelStatusType.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelStatus.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeUtil.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/Commands.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelMonitor.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeUtil.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeUtil.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeUtil.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeUtil.java
Show resolved
Hide resolved
Added Util for ephemeral error messages Modified Config to load FreeChannel config Improved Javadocs Added test Status message Rebased onto development
Added Util for ephemeral error messages Modified Config to load FreeChannel config Improved Javadocs Added test Status message Rebased onto development Cleaned code
added javadocs
Added status message editing Added on boot channel inactive check
7f24892
to
e49d8d4
Compare
ready to merge spotless is failing because of gradle deprecation |
application/src/main/java/org/togetherjava/tjbot/commands/free/ChannelStatus.java
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java
Outdated
Show resolved
Hide resolved
application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java
Outdated
Show resolved
Hide resolved
What? Whats wrong with gradle? Or is your branch behind? Then please rebase. |
Wait what, our current setup fails for all PRs? Why was it merged then, it has to be reverted. Or am I getting something wrong? We wont merge stuff that fails Spotless. |
@borgrel Spotless fails because your code is wrongly formatted. See here: |
Can you add a release checklist to the PR? I.e. what do we have to do when we merge this? I guess adjust the config, anything else? |
done |
7 days without further activity + 1 approving review. Hence, merging. |
Replace existing functionality
This command is not completed, it still needs a lot of work, this PR is just to replace the current provided features of the old free channel system. Some of the expected improvements will be mentioned in this PR.
Configuration
Simply add the channel id's where you want the output and a list of the channels to monitor to the config file. since the json is expected in an array format multiple guilds can easily be added or removed without needing to comb through a list of numbers to find the channels related to one specific guild. Internally the channels are not separated.
There is only allowed to be one status channel per guild, I see no reason why a guild will want to display the status message in multiple places. If a second entry is added to the settings array which points to the same guild no errors will occur and only one channel will end up mapped for that guild.
The bot will throw Illegal state exceptions if the channel id's added to the config do not point to
TextChannel
s.Status message
The bot will display the status in the designated configured channel.
The status message is currently identified by
bot is the author
andmessage includes embeds
.The final added check
embed has correct title
is not currently working. I believe this is because there is nogetTitleRaw()
method and the only solution I have thought of to date is to store the title constant as 2 strings which is not ideal.If another command places messages with embeds in the same channel this command will currently modify and or delete them!
Busy Channel
When a user posts a message in a currently free channel, they get an automated reply. All strings displayed directly to a user are stored in the enum
UserStrings
so that they are easily modifiable and easily comparable to ensure consistent tone and jargon and language.This feature needs expansion ...... when a user types in a free channel they will receive a prompt with buttons.
Are you asking a question?
Free Channel
When the channel is marked as free a message is displayed, for everybody to see. This message is easily modifiable in the
UserStrings
class.If a person tries to call the free command in a channel not currently being monitored they receive an ephemeral message stating such.
This feature needs expansion, when a helper tries to mark the channel as free the OP will receive a message with buttons asking if he is satisfied / finished before channel is marked as free. (This will require a timeout on the message as well as not triggering if the OP uses the /free command.
Inactivity
There is currently no scheduled process to check channels on a regular schedule and automatically mark them as available.
Since this is a feature expansion and not a replacement it is not included in this PR. However the bot uses this exact functionality on initialisation to generate the starting status of the channels, so once the bot receives Routine support (#235) it will be a simple method call to add that functionality.
Checklist
UserStrings
) (optional)(checking one channel should be enough)
(checking one channel should be enough)