Our servers are now running a Steam Workshop rotation, if you'd like your map to be considered for inclusion on our rotation, post in the rotation discussion thread

Or, if you just want to play some of the best community maps the Workshop has to offer, you can join our servers by clicking these links:

We now have a Steam Chat Bot!

Discussion in 'Site Discussion' started by Fantasmos, Nov 8, 2015.

  1. Fantasmos

    aa Fantasmos

    Messages:
    831
    Positive Ratings:
    883
    You read the title right folks, TF2Map’s Steam chat room is getting its very own bot!

    What is a steam-bot?
    You may ask, well it’s a user in chat that is 100% controlled by software, this means it can interact with the chat in awesome ways, such as keeping the chat updated with server status or having it's own commands!

    Right now the tasks are in 3 categories; Automatic, Manual and IMP-Commands

    Automatic Tasks

    Automatic commands require no input and will happen in the background:
    • Post map changes to the steam chat, if there are more than 4 players
    • Alert players who have submitted maps to it that their map is being ran
    • Changes username based on how many maps are logged
    • Uploads the map log online to a google spreadsheet
    • If set, will post a message of the day hourly
    • Updates the chat via msg whenever an update to TF2 is released
    • Updates the chatroom on map changes on the server when there are sufficient
    • If there are no messages for 10 minutes, the bot will leave and rejoin chat

    Manual Commands

    Manual commands require user input, so a command will be needed to run them. This can be done via msg or in the chat room, they are:

    !motd Posts the message of the day

    !VDC <Search> Searches the Valve Developer Community wiki and posts the result to chat

    !TF2 <search> Searches the TF2 WIki and posts the search result to the chat

    !TF2M <search> Searches TF2Maps and posts the result to chat

    !uploadcheck <map> Checks if the map is uploaded to TF2Maps servers

    !UsServer Gives current map and playercount for US server

    !euserver Gives current map and playercount for Eu Server

    /Help Links this webpage

    !join Adds the bot to the tf2maps chatroom


    Admin Commands

    The bot also has commands and functions restricted to admins:

    !enablesync Enables the sheet to sync online

    !disablesync Disables the sheet to sync online

    !rejoin Rejoins the chat, useful for ghosts

    !sync forces the bot to sync with the sheet online

    !SetMOTD Sets the message of the day

    !removeMOTD removes the message of the day

    say Posts anything said afterwards to the chatroom, keeping the username hidden

    Module Commands
    Rewrote a major component of the bot's back-end programming. Allowing a communication towards each individual module within the bot as well as further independence within these modules. Modules are kinda like singular "responsibilities" of the bot, one module would handle the map list whilst another would handle the MOTD for example
    • !modulelist can be used to show all currently activated modules
    • !moduleremove <modulename> can be used to remove a module, thus deactivating it (CASE SENSITIVE)
    • !moduleadd <modulename> can be used to re-add a module, no duplicates allowed
    Keep in mind the bot will not respond immediately confirming/denying if it was deleted/added, so you'll have to check yourself

    The modules are (all load on boot):
    • MotdModule
    • MapModule
    • UsersModule (Undeletable)
    • RepliesModule
    • AdminModule (Undeletable)
    • SearchModule
    • ImpNaoModule (Work in progress)
    • ServerModule
    A major benefit to this interface is now if the bot does something stupid, just delete the individual module not the whole bot (like spam server changes)

    Do keep in mind when the bot reboots it will reload all the modules, and that it'll reboot from a super-extended ghost

    Imp Commands

    The bot also has commands and functions to help with the running of imps they are:

    !ADD <Map Name> <DownloadURL> <notes> Adds the map and download url to the map list, a download URL is required even if the map is already uploaded to the servers, and everything after will be added as notes, if your map is over 50mb please specify this in the notes

    !maps posts a list of maps to the chat, and messages the sender the download urls

    !wipe (ADMIN ONLY) Clears the map list

    !delete <mapname> removes the map from the list, can only be done by the original sender or an admin.

    !updatemap <Current Entry> <New Map name> <New url> <New Notes>​

    These commands will help users who want to have their map imp’d but are unable to be in chat all the time, as Imp-Hosters will be able to check the map list for maps people have requested.
    Rules
    So there are some rules and punishments relating to bot-interaction:
    • Spamming Bot-Commands is equivalent to spamming Chat and will be treated accordingly
    • Do not ethically misuse the Any Command (bugs included), you may become blacklisted meaning you can no longer use ANY bot feature
    • If there is a command that is admin-only but a bug allows you to use it, do not use it and report it to this thread, you will become blacklisted for continued abuse
    What to discuss in this thread
    So, this thread will serve as a way for users to have any questions they have answered, as well as request for bot-features or report bugs.

    This thread will also be used to keep users updated about the bot's updates, like a map workshop... but for a bot.

    Thanks to:
    Layl + PuffBit: Helping out with a lot of the coding, a gigantic thanks for all the help provided.

    Fubar + Psy: Significant production on the bot


    Geit:
    Hosting the bot on his server, and showing me the ins and outs of running the server, as well as helping with complicated coding issues. Without geit's help this would not have got to the point it's at now.

    Yrr: Continuously contributing useful feedback to the bot
     
    • Thanks Thanks x 17
    • Useful Useful x 8
    • Creative Creative x 2
    Last edited: Sep 1, 2016
  2. JMaxchill

    JMaxchill L5: Dapper Member

    Messages:
    220
    Positive Ratings:
    63
    Is it possible for a player to remove their map from the list to imp; if they found a game-breaking bug, say?
    e: Also, can we have a !bot command that links to this post if people don't know which commands do which?
     
    Last edited: Nov 9, 2015
  3. Hyperion

    aa Hyperion L16: Grid Member

    Messages:
    670
    Positive Ratings:
    420
    Something like !imp remove would be nice if you mistype yours map name
     
    • Agree Agree x 2
  4. YM

    aa YM LVL100 YM

    Messages:
    7,079
    Positive Ratings:
    5,679
    Does it check that a map is on the server??

    Could easily do so by polling http://redirect.tf2maps.net/maps/ for the filename added to the imp.

    IMHO the !imp command should firs check there and then do two things:
    1. If the map is present, add it to the list of !maps command
    2. If it isn't, return something like "Use the !upload command with a URL to add to the upload queue" then people can use the !upload command with no URL after it to return the full list of maps to upload.
    This way, if someone has a map but it isn't uploaded, the imp host knows A) that it needs to be uploaded and B) the link to get the map in order to upload it.

    I forsee situations where an imp host does !maps and gets a bunch of maps that aren't uploaded as a result.

    Please also add a "!OopsIFuckedUp command so that people can remove their fuck up from the map list. You're tracking steamIDs so you should be able to do some kind of system where users can undo a typo into the imp list without needing an admin to clear it entirely.

    Aaaalallllssooo !help should return the URL of this thread.

    Just one more request: adding "quiet" or some similar keyword into the bot's command should prevent it from returning anything to the chat so that people can use multiple commands in quick succession if needs be without spamming up chat.

    Finally: Ban non-group members from using the bot.
     
    • Agree Agree x 4
    • Useful Useful x 1
  5. Fantasmos

    aa Fantasmos

    Messages:
    831
    Positive Ratings:
    883
    What it does is let users put in their own text, so they could do !imp Koth_backwoods <dropbox link>

    I'm planning on redoing the imp system soon, and will definitely add these features
     
  6. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,008
    Positive Ratings:
    780
    Do we clear the map list after each imp or is it good practice to leave the maps on there for 24 hours so they can be in more than one imp, say one EU and one US? Do the maps expire automatically? If not, then we could do that and we wouldn't have to clear the list, but it would also mean that the two sets of regional server users would playtest a map, and the author wouldn't need to be around to make sure it stays on the list.
     
  7. YM

    aa YM LVL100 YM

    Messages:
    7,079
    Positive Ratings:
    5,679
    Nah don't do that, that ability is getting used for the powers of evil and foolishness:
     
  8. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    3,883
    Positive Ratings:
    4,864
    I've already commented my disappointment that you can't add "maps" privately so as to leave a entire-bee-movie-script timebomb.
     
    • Like Like x 1
  9. Fantasmos

    aa Fantasmos

    Messages:
    831
    Positive Ratings:
    883
    Sweet, people are using the bot (gotta really clean the system though)

    Anyways bot update:

    Mostly internal stuff, I can now read and comment in chat through the bot, which is good (can do it on mobile as well) !clear works now (admin only still) and that's really it. I won't be in the bot chat 24/7 obviously though.
     
  10. Osspial

    Osspial L2: Junior Member

    Messages:
    63
    Positive Ratings:
    70
    It might be nice for people to be able to type multiple commands into one line of chat by separating them with semicolons.
     
  11. MegapiemanPHD

    MegapiemanPHD Doctorate in Deliciousness

    Messages:
    719
    Positive Ratings:
    264
    Would it be possible to include a "add to imp" function on TF2maps.net's website (if it's not already there)? I'm not one for public chats.
     
  12. Fantasmos

    aa Fantasmos

    Messages:
    831
    Positive Ratings:
    883
    So, the current system i'm considering, is when a !maps command is done, it will post the map list to chat, and PM the download links to the sender. I'm also considering making this command work when directly messaging the bot so 5 people don't spam to get download links. Thoughts?

    Edit: What about google sheets?
     
    • Thanks Thanks x 1
    Last edited: Nov 10, 2015
  13. Sergis

    aa Sergis L666: ])oo]v[

    Messages:
    1,856
    Positive Ratings:
    1,116
    if that thing can be taught to check if a map is on redirect, oops a typo command becomes obsolete

    unless of course someone has made and uploaded a map with your exact typo
     
  14. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    3,883
    Positive Ratings:
    4,864
    Also it's useful to add maps that aren't uploaded.
     
  15. JMaxchill

    JMaxchill L5: Dapper Member

    Messages:
    220
    Positive Ratings:
    63
  16. worMatty

    aa worMatty Repacking Evangelist

    Messages:
    1,008
    Positive Ratings:
    780
    Suggestion: Number each map as it's added to the list. For example, using the !maps command would show a list like this:

    1. cp_tekton_a8 , 2. cp_shortpeak_a6 , 3. cp_alpine_a3 , 4. http://tf2maps.net/resources/cp_intrusion.832/ , 5. cp_mard_a1c , 6. koth_overflow_b5 , 7. cp_pillowcase_a4 , 8. cp_bridgework_a2 , 9. cp_alpine_a3 if we dont have enough maps , 10. cp_bridgework_a2 http://tf2maps.net/resources/bridgework.926/ ,

    The reasons for this are:
    • You can tell at a glance just how many maps there are to be play tested
    • It would make identification and selection easier if there was a map deletion command introduced in future. The staff user could just type !delete 3 for example.
    • It helps separate the entries to make them more readable and prevents URLs and comments from spilling over in to adjacent entries.
    Thanks!
     
    • Agree Agree x 4
  17. Fantasmos

    aa Fantasmos

    Messages:
    831
    Positive Ratings:
    883
    The new imp system is on the road to being implemented!

    To begin using the system I encourage the following commands

    !add <mapname> <downloadURL> (Gets the map list
    !remove <Mapname> (only usable by the person who added the map and admins)
    !view (post the map list to chat and pm's the URL list, this is a temporary solution, the improvement will be awesome)
    !wipe (Removes all map from the list)

    I've been definitely reading this thread, and this new system will allow me to properly cater to these requests. Gotta just get the major components (these) cleaned up. The current system is going to be running parallel with this system, just so users don't get confused.
     
    • Thanks Thanks x 2
    • Like Like x 1
  18. LeSwordfish

    aa LeSwordfish semi-trained quasi-professional

    Messages:
    3,883
    Positive Ratings:
    4,864
    This may have already come up, but what about being able to check if a map is uploaded? !check koth_gunfight_a6 or something.
     
  19. Fantasmos

    aa Fantasmos

    Messages:
    831
    Positive Ratings:
    883
    Yeah, definitely been interested in doing this, and it's 100% feasible. I want to implement the google sheet system first though but this is 2nd on my list because it ties into my surprise feature.
     
    • Like Like x 1
  20. Davekillerish

    aa Davekillerish Lvl 1: Respectfully Disagree'd Member

    Messages:
    1,405
    Positive Ratings:
    749
    I love the bot, keep working on it, its an amazing addition to the community as a whole.
     
    • Agree Agree x 2
    • Like Like x 1