I'm trying to use Python code for a Discord Rich Presence integration. I ran into some problems.

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
BlueMatrixGames
Newbie
Posts: 2
Joined: Mon Jun 07, 2021 8:30 pm
Projects: Doki Doki A Violet Fate, Piano Keys, emotions.
IRC Nick: BlueMatrix
itch: BlueMatrix
Contact:

I'm trying to use Python code for a Discord Rich Presence integration. I ran into some problems.

#1 Post by BlueMatrixGames »

Code: Select all

I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/script.rpy", line 20, in script
    init -20 python:
  File "game/script.rpy", line 20, in script
    init -20 python:
  File "game/script.rpy", line 21, in <module>
    import discord_rpc
SyntaxError: invalid syntax (api.py, line 28)

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/bootstrap.py", line 326, in bootstrap
    renpy.main.main()
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/main.py", line 515, in main
    renpy.game.context().run(node)
  File "game/script.rpy", line 20, in script
    init -20 python:
  File "game/script.rpy", line 20, in script
    init -20 python:
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/ast.py", line 922, in execute
    renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/python.py", line 2218, in py_exec_bytecode
    exec(bytecode, globals, locals)
  File "game/script.rpy", line 21, in <module>
    import discord_rpc
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/loader.py", line 985, in load_module
    exec(code, mod.__dict__)
  File "python-packages/discord_rpc/__init__.py", line 30, in <module>
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/loader.py", line 985, in load_module
    exec(code, mod.__dict__)
  File "python-packages/requests/__init__.py", line 48, in <module>
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/loader.py", line 985, in load_module
    exec(code, mod.__dict__)
  File "python-packages/charset_normalizer/__init__.py", line 23, in <module>
  File "C:\Users\Administrator\Dropbox\My PC (main)\Downloads\renpy-7.4.5-sdk.7z\renpy-7.4.5-sdk/renpy/loader.py", line 979, in load_module
    code = compile(source, filename, 'exec', renpy.python.old_compile_flags, 1)
SyntaxError: invalid syntax (api.py, line 28)

Windows-10-10.0.19041
Ren'Py 7.4.5.1648
Piano Keys 1.0.1.3
Mon Sep  6 13:56:32 2021
Special games.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], downover, Google [Bot]