from typing import Union


def compose_tweet_action(tweet_id: Union[str, int], action: str):
    """:class:`str`: Make a link that lets you interact a tweet with certain actions.

    Parameters
    ------------
    tweet_id: Union[:class:`str`, :class:`int`]
        The tweet id you want to compose.
    action: str
        The action of a link.

    .. versionadded: 1.3.5
    """
    if action.lower() not in ("retweet", "like", "reply"):
        return TypeError("Action must be either 'retweet', 'like', or 'reply'")
    return (
        f"https://twitter.com/intent/{action}?tweet_id={tweet_id}"
        if action != "reply"
        else f"https://twitter.com/intent/tweet?in_reply_to={tweet_id}"
    )