Staff help plugin

Discussion in 'Plugin Requests' started by maks244, Jul 12, 2020.

  1. Offline

    maks244

    Plugin category: Chat

    Minecraft version: 1.8.8/1.12 (Ideally 1.12 but would be great if it worked for both)

    Suggested name: StaffHelp

    What I want:
    I'd like a plugin that adds the /help command to communicate directly with staff. Yes, this is from the GTM server.

    How this would work is when the user types '/help how do I buy stuff' they see a message saying "Your message has been sent to all online staff!" and their own message under that. All configurable of course. It would also be nice if it said something different if no staff members were online.

    Only the people with the right permission can see this message and respond to it by typing '/help respond <player> <message>'. After the response, if the player needs to give more details they can use '/help <message>' again but this time they won't get the "Your message has been sent to all online staff!" message so it doesn't spam their chat with that message every time. After 10 minutes of the player not responding with the /help command the message "Your message has been sent to all online staff!" will be shown again if they use /help again.

    This is optional but a list of open help requests would be very nice. I define an open request as one which hasn't been replied to by a staff member ever, this includes requests where a player asked something, staff answered and the player said something again but the staff member hasn't replied yet. This list would be accessed with the '/help list' command.

    Config example:
    Code:
    # Lines are separated by '//'
    help-opened: "&6Your message has been sent to all online staff! A staff member will respond to your query shortly."
    help-response-user: "&a&l[Help] &7%player% &8» &a%message%"
    help-response-staff: "&a&l[Help] &bStaff: &f%player% &8» &f%message%"
    help-list-title: "&8&m-----------------------------------------------------//&aOpen tickets"
    help-list-entry: "&7%target%: &a%message%"
    help-list-end: "&8&m-----------------------------------------------------"
    help-list-empty: "&cThere are no help requests at the moment."
    player-not-found: "&a&l[Help] &cThat player has not made a help request or is offline"
    help-invalid-arguments: "&7Usage: &a/help <message>"
    help-respond-invalid-arguments: "&7Usage: &a/help respond <player> <message>"
    Ideas for commands/permissions:
    /help <message> - staffhelp.help - Sends a message to all online staff
    /help respond <player> <message> - staffhelp.respond - Sends a response
    (optional) /help list - staffhelp.list - Shows a list of open help requests
    (optional) /staffhelp reload - staffhelp.reload - Reloads the config

    When I'd like it by: Ideally within 2 months.
     
    Xp10d3 likes this.
  2. Offline

    Xp10d3

    Great concept! I can try and do this. No guarantees I’ll be able to finish the whole thing soon as I’m quite busy but I actually need something like this on my server anyways, and I like this idea.
    EDIT: is it alright if I post this on Bukkit or Spigot? I also will need to add a feature that adds users to a staff list. It’ll be /staffhelp add <user>. Then that way all messages will get sent to a staff member.


    Sent from my iPhone using Tapatalk
     
  3. Offline

    maks244

    Yes, of course you can post it on Bukkit/Spigot. And that extra command is also fine.

    Edit: Can you also add an alias for the respond command? Something like /help r <player> <message>
     
    Last edited: Jul 13, 2020
  4. Offline

    Xp10d3

    @maks244 Sure. An alias shouldn't be too difficult. I'm currently working on the /addstaff command but for some reason encountering some issues. I'll let you know on any more updates.
     
  5. Offline

    JanTuck

    I had some fun, this probably doesn't work 100%, but feel free to try it out.

    Get it here: https://drive.google.com/file/d/1NvcrVsQx_vm78Nzo4hmCQueqPEoEaynk/view?usp=sharing

    It requires Paper, which can be found here https://papermc.io/downloads

    Commands are:
    staffhelp help
    staffhelp reloadconfig
    staffhelp list - Show list of current active tickets.
    staffhelp nextpage - Go to next page, needs to have run /staffhelp list previously
    staffhelp view - View your own conversations
    staffhelp view <player> - View the conversation made by staff and the user in a ticket.
    staffhelp prevpage - Go to prev page, needs to have run /staffhelp list previously
    staffhelp closeticket <player> - Close a ticket
    staffhelp respond <player> <message> - Respond to an open ticket.
    staffhelp <message> - Create a help request or respond to the opened one.

    Permissions are:
    staffhelp help - staffhelp.base.help
    staffhelp reloadconfig - staffhelp.base.reload
    staffhelp list - staffhelp.base.list
    staffhelp nextpage - staffhelp.base
    staffhelp view - staffhelp.base.view.self
    staffhelp view <player> - staffhelp.base.view.others
    staffhelp prevpage - staffhelp.base
    staffhelp closeticket <player> - staffhelp.base.closeticket
    staffhelp respond <player> <message> - staffhelp.base.respond
    staffhelp <message> - staffhelp.base.use
    staffhelp.base.notify - This is the perm to see when a user creates a help ticket.
    Images:
    staffhelp help
    [​IMG]
    staffhelp reloadconfig
    [​IMG]
    staffhelp <message> (Notice the twice the message, that is because i have the perm `staffhelp.base.notify`)
    [​IMG]
    staffhelp list
    [​IMG]
    staffhelp view / staffhelp view <player> - Before a staff response or any other convo
    [​IMG]
    staffhelp response <player> <message>
    [​IMG]
    [​IMG]
    the view after
    [​IMG]
    staffhelp <message> - By issuer && the view after
    [​IMG]
    staffhelp closeticket <ticket>
    [​IMG]
    staffhelp list - afterwards
    [​IMG]

    Configuration uses Minedown find it here https://github.com/Phoenix616/MineDown
    There is documentation on that github page.
    Configuration:
    Code:
    ticket-open: "&green&Message was sent to staff, please hold for a response!"
    ticket-failure: "&red&Unable to register/respond/failure to that ticket, please try again?"
    ticket-user-response: "&green&[Help] &yellow&%player% &green&>> &white&%message%"
    tickets-staff-response: "&green&[Help] &light_purple&STAFF &yellow&%player% &green&>> &white&%message%"
    ticket-view-start: "&green&<-Conversation start->"
    ticket-view-end: "&green&<-Conversation end->"
    help-list-start: "&green&<--&yellow&Open Tickets&green&-->"
    help-list-entry: "[&yellow&%player% &green&>> &yellow&%message%&green& | %status%](run_command=/staffhelp view %player% hover=&green&Click to view conversation for this user.)"
    help-list-end: "[&green&<--](run_command=/staffhelp prevpage)&yellow&Page %current%&green&/&yellow&%amount%[&green&-->](run_command=/staffhelp nextpage)"
    help-list-empty: "&red&No tickets at the moment!"
    no-request-by-player: "&red&No request found by that player, did you mistype?"
    ticket-removed: "&green&Ticket was removed successfully"
    config-reload: "&green&Config Reloaded"

    I will now head to bed, let me know what you think. Would also love to see what Xp10d3 comes up with ;)
     
    Xp10d3 likes this.
  6. Offline

    maks244

    Does it really need paper? I specifically avoid paper because of the lack of support and because the console is really, really SHIT in 1.8.8 paper. What you've done looks very good though.

    I do have some suggestions though. The main command for requesting help needs to be /help and I would like the requests to close automatically in 10 minutes if there's no response from the player.
     
    Last edited: Jul 13, 2020
  7. Offline

    JanTuck

    Sigh, I forgot where we were, that will only work on a newer version of Minecraft, and it will only work on Paper yes.

    The main command has the help alias so that is already there, I suppose the autoclose can be done, but be configurable.

    But I only really made it for 1.13+, so I'm sorry if I got your hopes up.
     
  8. Offline

    maks244

    That's okay, I'll just wait for Xp10d3's version.
     
  9. Offline

    Xp10d3

    It should still work if you remove Bungee chat and Bungee support. It'll work in 1.8.8 then. Change the build path of Paper to 1.8.8 Bukkit and then try and fix the errors. If it's alright can I decompile your jar and change the version? Might be a bit easier for both maks244 and me :p If not that's alright.
     
  10. Offline

    JanTuck

    Go for it, haha.
     
  11. Offline

    maks244

    Will it work then for 1.12 also? And if you succeed can you add the auto close function? It would be nice if that was configurable too.
     
  12. Offline

    Xp10d3

    Sorry, can you send your src? Or at least the dependencies? I decompiled it except the decompiler is trash and spat out like fifty million folders. I saw a bunch of dependencies but not much-made sense lol. Sorry.
     
    JanTuck likes this.
  13. Offline

    JanTuck

    Last edited: Jul 14, 2020
    Xp10d3 likes this.
  14. Offline

    Xp10d3

    Ty <3 Any dependencies?
    EDIT: Sorry forgot to reply to your post @maks244 ;-; I'll try and test the plugin in 1.12.2 if I end up editing JanTuck's code and will let you know. It'll likely work as 1.8 -> 1.12 isn't too big of a version jump, but I'll try and confirm that as best as I can.
     
  15. Offline

    JanTuck

    It's a gradle project
     
  16. Offline

    Xp10d3

    Ah I see. One more thing (sorry!): I use Eclipse and not IntelliJ, and the files are a bit strange. Can't seem to convert them from the kotlin format to the .java format. And when I just copy + paste it into .java, I get a bunch of errors. Is it possible for you to change the format? Sorry...
     
  17. Offline

    gochi9

    Ok i'll take over if that's ok with JanTruck but i will make it from scratch. Also just a question,i was thinking about a way to get the history requests.Would you like it in a chat format or a gui format? Or none at all?
     
    Xp10d3 likes this.
  18. Offline

    maks244

    A GUI would be great if you could do that cause then you can have more requests on-screen but I don't know in what case I would have to look into the history of all requests so I don't know if it's needed.
     
  19. Offline

    gochi9

    The how about i add the open requests at the moment in a GUI.And maybe i can save the closed request in a file so you can take a look at how your staff is helping other players
     
  20. Offline

    maks244

    That would be great! Make sure to automatically close the requests after 10 minutes (configurable)
     
  21. Offline

    gochi9

    Well ok.Should it be a message to the staff and the player once the request gets closed when the time expires?
     
  22. Offline

    maks244

    No, it's cleaner that way.
     
  23. Offline

    gochi9

    This is the plugin

    Commands:
    /help [message] - Permission: staffhelp.createticket
    /help [player] [message] - Permission - staffhelp.anwserticket
    /help gui - Permission: staffhelp.opengui
    /help close - Permission: staffhelp.createticket
    /help close [player] - Permission: staffhelp.closeticket

    Clicking on a ticket in a gui will display, the one who clicked, the entire conversation.Haven't tested a gui much,nor the plugin.Tell me if you find any bugs
     
  24. Offline

    maks244

    Current bugs:
    • The whole config doesn't seem to do anything (config: &green&[Help] &light_purple&STAFF &yellow&%player% &green&>> &white&%message% - in-game: https://i.imgur.com/lTjMbzO.png)
    • There are missing configs such as when the request automatically closes
    • This error when you click on something in your inventory or in another GUI https://pastebin.com/A1iMmdMK
    • The request opener sees this message https://i.imgur.com/mGbdPr2.png. They also see it every time they say something with /help before a staff member replies which is not intended
    • The requests close automatically after no response from staff. Requests should ONLY close automatically if the staff was the last to say something
    Also instead of staff seeing this when someone opens a request: https://i.imgur.com/YyvHW9H.png
    I would like them to see this: https://i.imgur.com/S24zQpI.png

    EDIT: I get an error when trying to access the GUI after someone made a request
    Code:
    [21:40:19 INFO]: Julka244 issued server command: /help please help asdsasdgasgd
    [21:40:24 INFO]: GamingDay issued server command: /help gui
    [21:40:24 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'help' in plugin StaffHelp v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at me.incomprehendable.dev.pwp.FakeSimpleCommandMap.dispatch(FakeSimpleCommandMap.java:98) ~[?:?]
            at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1162) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:997) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_251]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_251]
            at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
    Caused by: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_12_R1/inventory/CraftItemStack
            at com.deadshotmdf.StaffHelp.Utils.ItemUtil.nmsCreateItem(ItemUtil.java:32) ~[?:?]
            at com.deadshotmdf.StaffHelp.Utils.Maps.openRequestsItems(Maps.java:29) ~[?:?]
            at com.deadshotmdf.StaffHelp.Inventories.HistoryGUI.onInv(HistoryGUI.java:54) ~[?:?]
            at com.deadshotmdf.StaffHelp.Commands.OpenTicketCommand.onCommand(OpenTicketCommand.java:89) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            ... 15 more
    Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_251]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_251]
            at com.deadshotmdf.StaffHelp.Utils.ItemUtil.nmsCreateItem(ItemUtil.java:32) ~[?:?]
            at com.deadshotmdf.StaffHelp.Utils.Maps.openRequestsItems(Maps.java:29) ~[?:?]
            at com.deadshotmdf.StaffHelp.Inventories.HistoryGUI.onInv(HistoryGUI.java:54) ~[?:?]
            at com.deadshotmdf.StaffHelp.Commands.OpenTicketCommand.onCommand(OpenTicketCommand.java:89) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot-1.8.8.jar:git-Spigot-db6de12-18fbb24]
            ... 15 more
     
    Last edited: Jul 17, 2020
  25. Offline

    gochi9

    Oh shoot.Guess i should've tested it before posting.I'll fix them

    EDIT: You requested that the plugin would be made for 1.12 and you are testing it on 1.8,the last error happends because of this

    &green&[Help] &light_purple&STAFF &yellow&%player% &green&>> &white&%message% The replacement is not %player% and it is {player}, same for %message% it is {message} and in the config you will not see any %% only {}

    There is a message when the ticket automatically closes [​IMG]

    The messages in the config can be changed: [​IMG]
    Also the sender does not receive the same 'open request' message every time until another staff answer and it works well

    That only problems that actually are the same would be the first error console which i am going to fix and the seconds which is because you are testing it on a 1.8 server

    This is the plugin, that error is fixed here
     
    Last edited: Jul 17, 2020
    Xp10d3 likes this.
  26. Offline

    maks244

    Works way better!
    Some bugs:
    • The request still gets closed when staff didn't reply yet https://i.imgur.com/25bxZvn.png.
    • I've also noticed that there's an extra space before the message of staff https://i.imgur.com/pLg2gIM.png
    • When the player begins their /help request with a name or with "close" it says you don't have the right permissions
    I also have some suggestions:
    • Make the message for a closed ticket because of time-out configurable
    • Make the "formatTicket" for the user and for staff so the staff can have a different format.
    • You don't have to do this but it would be a very nice addition if you could make it so when you click someone's help request in chat it suggests the command "/help {player} " so you can respond quicker
     
  27. Offline

    gochi9

    Oh you meant to close the ticket after the configurable time only if a staff answered at least once.My bad didn't get that one.Will edit it later
     
  28. Offline

    maks244

    Well not only once, I don't want it to close at all if the last message was from the player (Except for a manual close).
    So if a player asks something, staff answers, then player says something again it still can't close. But if the staff answers again it can close.
     
    Last edited: Jul 17, 2020
  29. Offline

    gochi9

    This is the plugin

    Delete the old plugin folder and let a new one regenerate.

    See if you like it.Report any bugs
     
  30. Offline

    maks244

    They still get closed if no-one replies https://i.imgur.com/tpxY2jp.png and there still isn't a configuration for the message: "The ticket for the player {player} has been closed by No response in the configurable time"

    Apart from that, I need one more thing. This is my createdTicket right now:
    Code:
    createdTicket: '&7Your message has been sent to all online staff! A staff member will respond to your query shortly.                        &a[Help] &7{player} &8» &a{message}'
    And this is the output. This isn't the best solution and because of this staff sees the message "Your message has been sent to all online staff! A staff member will respond to your query shortly." too.
    I want the createdTicket to be only this:
    Code:
    createdTicket: '&7Your message has been sent to all online staff! A staff member will respond to your query shortly.'
    but the output to still be the same. To achieve this you can just print out 2 things for the user: createdTicket and senderResponse. Then you can make it so createdTicket doesn't get sent to staff so the staff don't get the same message as the user.

    If you can do this the plugin will be perfect!
     
    Last edited: Jul 22, 2020

Share This Page