m-haisham/novelsave

Railway

Closed this issue · 13 comments

You should consider railway as an alternative for heroku. For me, I think it has more up time (dynos). I have tried deploying python repos on railway and majority of them works. It can also run repos with heroku built in it.

I'll check it out

The app will deploy to railway correctly now. It will use the dockerfile for build.

I tried deploying the bot on railway but I get this errors

Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/app/novelsave/__main__.py", line 9, in <module>
discord.main()
File "/app/novelsave/client/bots/discord/main.py", line 25, in main
discord_application = wire([endpoints, session])
File "/app/novelsave/client/bots/discord/main.py", line 14, in wire
discord_application.wire(packages=packages)
File "src/dependency_injector/containers.pyx", line 317, in dependency_injector.containers.DynamicContainer.wire
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 361, in wire
_patch_attribute(cls, cls_member_name, cls_member, providers_map)
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 482, in _patch_attribute
instance = provider()
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
File "src/dependency_injector/providers.pyx", line 2954, in dependency_injector.providers.Singleton._provide
File "src/dependency_injector/providers.pxd", line 645, in dependency_injector.providers.__factory_call
File "src/dependency_injector/providers.pxd", line 572, in dependency_injector.providers.__call
File "src/dependency_injector/providers.pxd", line 440, in dependency_injector.providers.__provide_keyword_args
File "src/dependency_injector/providers.pxd", line 360, in dependency_injector.providers.__get_value
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
File "src/dependency_injector/providers.pyx", line 4149, in dependency_injector.providers.Selector._provide
dependency_injector.errors.Error: Selector has no "no  # disable search functionality" provider
Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/app/novelsave/__main__.py", line 9, in <module>
discord.main()
File "/app/novelsave/client/bots/discord/main.py", line 25, in main
discord_application = wire([endpoints, session])
File "/app/novelsave/client/bots/discord/main.py", line 14, in wire
discord_application.wire(packages=packages)
File "src/dependency_injector/containers.pyx", line 317, in dependency_injector.containers.DynamicContainer.wire
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 361, in wire
_patch_attribute(cls, cls_member_name, cls_member, providers_map)
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 482, in _patch_attribute
instance = provider()
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
File "src/dependency_injector/providers.pyx", line 2954, in dependency_injector.providers.Singleton._provide
File "src/dependency_injector/providers.pxd", line 645, in dependency_injector.providers.__factory_call
File "src/dependency_injector/providers.pxd", line 572, in dependency_injector.providers.__call
File "src/dependency_injector/providers.pxd", line 440, in dependency_injector.providers.__provide_keyword_args
File "src/dependency_injector/providers.pxd", line 360, in dependency_injector.providers.__get_value
File "src/dependency_injector/providers.pyx", line 4149, in dependency_injector.providers.Selector._provide
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
dependency_injector.errors.Error: Selector has no "no  # disable search functionality" provider
Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/app/novelsave/__main__.py", line 9, in <module>
discord.main()
File "/app/novelsave/client/bots/discord/main.py", line 25, in main
discord_application = wire([endpoints, session])
File "/app/novelsave/client/bots/discord/main.py", line 14, in wire
discord_application.wire(packages=packages)
File "src/dependency_injector/containers.pyx", line 317, in dependency_injector.containers.DynamicContainer.wire
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 361, in wire
_patch_attribute(cls, cls_member_name, cls_member, providers_map)
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 482, in _patch_attribute
instance = provider()
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
File "src/dependency_injector/providers.pyx", line 2954, in dependency_injector.providers.Singleton._provide
File "src/dependency_injector/providers.pxd", line 645, in dependency_injector.providers.__factory_call
File "src/dependency_injector/providers.pxd", line 572, in dependency_injector.providers.__call
File "src/dependency_injector/providers.pxd", line 440, in dependency_injector.providers.__provide_keyword_args
File "src/dependency_injector/providers.pxd", line 360, in dependency_injector.providers.__get_value
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
File "src/dependency_injector/providers.pyx", line 4149, in dependency_injector.providers.Selector._provide
dependency_injector.errors.Error: Selector has no "no  # disable search functionality" provider
Traceback (most recent call last):
File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/app/novelsave/__main__.py", line 9, in <module>
discord.main()
File "/app/novelsave/client/bots/discord/main.py", line 25, in main
discord_application = wire([endpoints, session])
File "/app/novelsave/client/bots/discord/main.py", line 14, in wire
discord_application.wire(packages=packages)
File "src/dependency_injector/containers.pyx", line 317, in dependency_injector.containers.DynamicContainer.wire
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 361, in wire
_patch_attribute(cls, cls_member_name, cls_member, providers_map)
File "/usr/local/lib/python3.9/site-packages/dependency_injector/wiring.py", line 482, in _patch_attribute
instance = provider()
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
File "src/dependency_injector/providers.pyx", line 2954, in dependency_injector.providers.Singleton._provide
File "src/dependency_injector/providers.pxd", line 645, in dependency_injector.providers.__factory_call
File "src/dependency_injector/providers.pxd", line 572, in dependency_injector.providers.__call
File "src/dependency_injector/providers.pxd", line 440, in dependency_injector.providers.__provide_keyword_args
File "src/dependency_injector/providers.pxd", line 360, in dependency_injector.providers.__get_value
File "src/dependency_injector/providers.pyx", line 224, in dependency_injector.providers.Provider.__call__
File "src/dependency_injector/providers.pyx", line 4149, in dependency_injector.providers.Selector._provide
dependency_injector.errors.Error: Selector has no "no  # disable search functionality" provider

When you are setting the environment make sure to remove the comments

DISCORD_SEARCH_DISABLED=no

Instead of

DISCORD_SEARCH_DISABLED=no  # Disable search functionality

what does this mean?

if channel.type is not ChannelType.private and channel.type is not ChannelType.group: The above exception was the direct cause of the following exception: nextcord.errors.ApplicationInvokeError: Command raised an exception: AttributeError: 'Object' object has no attribute 'type'

bot won't reply to /dm command in group

And I'll get this error when I attempt to download 'Object' object has no attribute 'type' or this I'm busy retrieving novel information.

The last update i made to the repo 48b1789 fixed that issue, there are some problems with the newest versions of nextcord. Maybe you're using an old version.

This update ensures that correct dependencies are installed with requirements.txt.

bot won't reply to /dm command in group

the other problems have been solve, thank you! This how do I solve this? The bot won't send direct message if a member send /dm

Check to see if the bot has the appropriate permissions.

Check to see if the bot has the appropriate permissions.
I checked the send messages.

I'll need more information before I can suggest anything else.

Below is the novelsave official bot's permissions in developer portal.
Screenshot_20220329_042045

Thank you! It worked