Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server
http://dinnerbone.com/minecraft/tools/status/
1.11k stars 146 forks source link

Exception when trying to use the repository #58

Closed Jm56Z closed 7 years ago

Jm56Z commented 7 years ago

I use MacOS Sierra

I downloaded the repository (with git clone https://github.com/Dinnerbone/mcstatus on the command line) Then I included the few lines told in the main page of this repo in a js file meant to be a discord bot : from /Users/*********/mcstatus import MinecraftServer; And I get this error :

from /Users/*********/mcstatus import MinecraftServer;
                               ^^^^^^

SyntaxError: Unexpected token import
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:537:28)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Function.Module.runMain (module.js:609:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:598:3

I also have the node.js and discord.js files... Can anyone explain me what this error means ? Being new to coding is quite hard...

MarkL4YG commented 7 years ago

You can't just import python code in JavaScript. You may be able to create a python script and call that from your JS.

Jm56Z commented 7 years ago

Thanks for your fast reply ! I'll try and watch many other tutorials on youtube xD