Skip to content

Why does the args.length stops command from running. #50

Answered by tintinkung
S4ge-Rites asked this question in Q&A
Discussion options

You must be logged in to vote

prefixcases command Fixed

completed code:

module.exports = {
    name: "cases",
    execute(message, args) {
        
        axios.get(`https://api.covid19api.com/total/country/${String(args[0])}`)
            .then(response => 
            {

                message.reply(`Data: https://api.covid19api.com/total/country/${String(args[0])}
                Confirmed: ${response.data[response.data.length - 1].Confirmed},
                Deaths: ${response.data[response.data.length - 1].Deaths}, 
                Recovered: ${response.data[response.data.length - 1].Recovered}, 
                Active: ${response.data[response.data.length - 1].Active}`)
                
            }
        ).c…

Replies: 6 comments 8 replies

Comment options

You must be logged in to vote
1 reply
@tintinkung
Comment options

Comment options

You must be logged in to vote
6 replies
@S4ge-Rites
Comment options

@StoneMcYT
Comment options

@S4ge-Rites
Comment options

@S4ge-Rites
Comment options

@StoneMcYT
Comment options

Comment options

You must be logged in to vote
1 reply
@tintinkung
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by StoneMcYT
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working question Further information is requested
3 participants