Skip to content

How to make bot say a random line of text? #5358

Closed Locked Answered by Androz2091
TheCappo asked this question in Q&A
Discussion options

You must be logged in to vote

You can store your words in an array, then pick a random item.

module.exports= {
    name: 'insult',
    description: "insults someone",
    execute(message, args){
        const words = [ 'noob', 'another-adjective', 'etc..' ];
        const item = words[Math.floor(Math.random() * words.length)];
        message.channel.send(`hey ${message.mentions.users.first()}, ur a ${item} :regional_indicator_l: :regional_indicator_l: :regional_indicator_l: :regional_indicator_l:`);
    }
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@TheCappo
Comment options

@Androz2091
Comment options

Answer selected by iCrawl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants