Skip to content
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

Add mod button-like placeholders in right click commands #3765

Merged

Conversation

Mm2PL
Copy link
Collaborator

@Mm2PL Mm2PL commented May 22, 2022

Pull request checklist:

  • CHANGELOG.md was updated, if applicable
  • swap context lookup order

Description

This also adds new placeholder input.text which returns the text the user has in their SplitInput. I've also changed behavior of CommandController to use variables given to it first then try to use global ones.

Some things I came up with:

/reply /raw @reply-parent-msg-id={msg.id} PRIVMSG #{channel.name} :{input.text} Sends a Twitch reply with the given text
/quote_reply /raw @reply-parent-msg-id={msg.id} PRIVMSG #{channel.name} :{input.text} > {1+} Sends a Twitch reply with the selected text/whole message
/translate /openurl https://translate.google.com/?sl=auto&tl=en&text={1+}&op=translate Opens Google Translate with the given message/selection

You can somewhat use right-click commands like normal ones even with custom placeholders:

/testing /testing {input.text;NaM} Will send testing {text in split input} if used from right-click command or NaM if not

@Mm2PL Mm2PL requested a review from zneix May 22, 2022 22:19
@xel86
Copy link
Contributor

xel86 commented May 23, 2022

Tested and works great! Thanks mm2pl

Edit: I do think its a bit weird that these new placeholders only work for commands when right clicking them rather than just typing like normal. I feel like the behavior of a command (other than the input) shouldn't change based on whether you type it or use the message context menu.

@zneix
Copy link
Collaborator

zneix commented May 23, 2022

After a brief look code looks good, I'll test these changes later on 👌

Copy link
Contributor

@xHeaveny xHeaveny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea it works good

Copy link
Member

@pajlada pajlada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected! Merge this it when you're happy with it @zneix

@zneix zneix enabled auto-merge (squash) May 29, 2022 11:59
@zneix zneix merged commit c8f5d35 into master May 29, 2022
@zneix zneix deleted the feature/mod_button-like_placeholders_in_right_click_commands branch May 29, 2022 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants