Implemented ChatDialog suggestions

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

  1. Aidden

    Aidden The better executive ;)

    Joined:
    Dec 3, 2013
    Messages:
    3,363
    Likes Received:
    678
    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

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,935
    Likes Received:
    853
    Supporteroni
     
  3. Cloud

    Cloud The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,378
    Likes Received:
    781
    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 The better executive ;)

    Joined:
    Dec 3, 2013
    Messages:
    3,363
    Likes Received:
    678
    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 The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,378
    Likes Received:
    781
    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

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,935
    Likes Received:
    853
    You could use the String... argument, since that takes multiple Strings?
     
  7. Aidden

    Aidden The better executive ;)

    Joined:
    Dec 3, 2013
    Messages:
    3,363
    Likes Received:
    678
    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:
    429
    Likes Received:
    119
    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:
    23
    Likes Received:
    1
    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

    SlashnHax The Chosen One

    Joined:
    Dec 10, 2014
    Messages:
    2,935
    Likes Received:
    853
    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 The Developer

    Joined:
    Jul 28, 2013
    Messages:
    2,378
    Likes Received:
    781
    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,525
    Likes Received:
    1,041
    I support. Clarity > Compactness.
     
  13. Cloud

    Cloud The Developer

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

    Salvation First Bot Author

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

Share This Page

Loading...