1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Implemented ChatDialog suggestions

Discussion in 'Client & Site Suggestions' started by Aidden, Jun 26, 2015.

  1. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    I think ChatDialog.getTitle() and getOption(Pattern) would be very useful. The latter making it possible to deal with an entire conversation in one line of code.

    @Cloud
     
  2. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    Supporteroni
     
  3. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Support for ChatDialog.getTitle
    In regards to getOption(Pattern), what exactly would it be matching against? The text? Would only one pattern be required in the constructor or should we accept multiple for further simplicity?

    Edit: Added Option getOption(Pattern... patterns)
     
  4. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    The text is what i had in mind. My idea was if i need to handle selecting multiple options going deep into a chat dialog, instead of having X if statements all checking the text, or a for loop looping over them and checking the text, i could just write a pattern that handled all options i need to choose
     
  5. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    I mean currently you can pass in multiple Strings and it will return the first option containing one of them. But I've gone ahead and added the ability to use Patterns within itt.
     
  6. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    You could use the String... argument, since that takes multiple Strings?
     
  7. Aidden

    Aidden Author of MaxiBots

    Joined:
    Dec 3, 2013
    Messages:
    6,482
    Likes Received:
    990
    Oh, i didn't realize it already took a vararg. Is there any benefit to having both?
    --- Double Post Merged, Jun 26, 2015, Original Post Date: Jun 26, 2015 ---
    Yeah lol just found that out
     
  8. Infinite Inferno

    Infinite Inferno The Pip Collector

    Joined:
    Sep 14, 2014
    Messages:
    445
    Likes Received:
    122
    So the string argument is based on the hierarchy of options right? So if an option is placed first, then another next, it will look for the first one before going to the second one?
     
  9. Overflow

    Joined:
    Mar 26, 2014
    Messages:
    33
    Likes Received:
    4
    Theres no need for it to be varags really, if there are multiple text options that would be viable or must be there the user can already specify this in there regex pattern
     
  10. SlashnHax

    Joined:
    Dec 10, 2014
    Messages:
    3,198
    Likes Received:
    1,041
    Ehhh, I'm sure there's still some edge case where varargs are needed, or at least more practical than jamming them all into a single pattern
     
  11. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    My logic was that it's easier to write simple patterns than it is complex ones.
     
  12. Arbiter

    Arbiter Mod Automation

    Joined:
    Jul 26, 2013
    Messages:
    2,937
    Likes Received:
    1,266
    I support. Clarity > Compactness.
     
  13. Cloud

    Cloud Engineer

    Joined:
    Jul 28, 2013
    Messages:
    2,777
    Likes Received:
    1,124
    Anyways, all of this is available in the latest release :)
     
  14. Salvation

    Salvation First Bot Author

    Joined:
    Aug 7, 2013
    Messages:
    262
    Likes Received:
    68
    You can create separate patterns and join them at compile time easily, though.
     

Share This Page

Loading...