I have declared a variable beforehand called:
var mathsLesson = 'https://www.link1.com';
The value of this variable will change
if (message.content === '!change') { //this checks if the user messages !change
mathsLesson = 'https://www.link2.com'
message.channel.send(mathsLesson); //This outputs www.link2.com
}
However when I output mathsLesson outside the if statement, it shows 'www.link1.com' instead of 'www.link2.com' which I wanted. How do I make it output 'www.link2.com'? Thanks in advance!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…