#discord.js

26 messages · Page 1 of 1 (latest)

queen gyro
#
    if (command === 'random'){
      let r = Math.floor(Math.random() * 10) + 1
      let guess = args.join(" ");
      if (guess === r) {       
        message.channel.send(`Guessed right! Bot: ${r} Yours: ${guess}`)
    } else {
        message.channel.send(`Wrong guess! Bot: ${r} Yours: ${guess}`)
#

anyone know why it saying wrong gess?

rich spire
#

change guess in if to +guess

queen gyro
#

new to js, use to python thanks lol

rich spire
#

no worries ^^

queen gyro
#

thank you!

#
/home/runner/minecraft-api-bog/index.js:3
import { authenticate } from '@xboxreplay/xboxlive-auth';
^^^^^^

SyntaxError: Cannot use import statement outside a module
#
import { authenticate } from '@xboxreplay/xboxlive-auth';
#

and this?

rich spire
#

not sure what you are trying to do, generally looks like you mixing up syntaxes 😅

#

hard to explain

#

use deno

queen gyro
#

using replit

#

¯_(ツ)_/¯

#

Im trying to get into minceraft realm api

rich spire
#

I see what you are importing, but I don't see what you are doing

#

generally .js file doesn't look like deno to me

queen gyro
#
const xbl = await authenticate('email', 'pass', {
    XSTSRelyingParty: 'https://pocket.realms.minecraft.net/'
});
console.log(xbl);
rich spire
#

most likely you are using node

queen gyro
#

I am

rich spire
#

I suggest reading more about node module resolution

queen gyro
#

ok

rich spire
#

good luck ❤️

queen gyro
#

thanks