automatic commenting for users on the home page of Twitter

this is my code for automatic commenting for users on the home page of Twitter. The code clicks on the comments, but does not leave the desired comment.I want to set up a code to send a message to users with a 20 second break.

// Function to click the reply button on a tweet
function clickReplyButton(tweet) {
    const replyButton = tweet.querySelector('div[data-testid="reply"]');
    if (replyButton) {
        replyButton.click();
    }
}

// Function to type a comment and submit
async function typeComment(commentText) {
    const commentBox = document.querySelector('div[data-testid="tweetTextArea_0"]');
    if (commentBox) {
        commentBox.focus();
        document.execCommand('insertText', false, commentText);

        // Wait for the comment to be typed
        await new Promise(resolve => setTimeout(resolve, 500));

        const tweetButton = document.querySelector('div[data-testid="tweetButton"]');
        if (tweetButton) {
            tweetButton.click();
        }
    }
}

// Function to comment on timeline tweets
async function commentOnTimeline() {
    const tweets = document.querySelectorAll('article[data-testid="tweet"]');

    for (const tweet of tweets) {
        clickReplyButton(tweet);

        // Wait for the reply box to appear
        await new Promise(resolve => setTimeout(resolve, 1000));

        typeComment('Hello');

        // Wait for the comment to be posted
        await new Promise(resolve => setTimeout(resolve, 2000));
    }
}

// Run the bot
commentOnTimeline()