Hi i want to ask how to use int 'randomnumber' from method 'onGuildMessageReceived' to method 'onGuildMessageReactionAdd'String[] = Questions{}; String[] = Answers1{}; String[] = correctAnswers{}; public void onGuildMessageReceived(GuildMessageReceivedEvent event){ String[] args = event.getMessage().getContentRaw().split("\\s+"); if (args[0].equalsIgnoreCase(Quiz.prefix + "Question")){ Random rnd = new Random(); int randomnumber = rnd.nextInt(Questions.length); EmbedBuilder Question = new EmbedBuilder(); Question.setTitle("📋 " + Questions[randomnumber]); Question.setDescription(Answers[randomnumber]); Question.setColor(0x00ff99); event.getChannel().sendTyping().queue(); Message msg=event.getChannel().sendMessage(Question.build()).complete(); msg.addReaction("🥇").queue(); msg.addReaction("🥈").queue(); msg.addReaction("🥉").queue(); Question.clear(); } } public void onGuildMessageReactionAdd(GuildMessageReactionAddEvent event) { if(Answers1[randomnumber].equals(correctAnswers[randomnumber]){} }
thanks for any answers