Billy
Billy
RRailway
Created by Billy on 8/30/2024 in #✋|help
Twitter/X API failing requests (401: Unauthorized) only when hosted on Railway
working now
6 replies
RRailway
Created by Billy on 8/30/2024 in #✋|help
Twitter/X API failing requests (401: Unauthorized) only when hosted on Railway
maybe so
6 replies
RRailway
Created by Billy on 8/30/2024 in #✋|help
Twitter/X API failing requests (401: Unauthorized) only when hosted on Railway
N/A
6 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
Dude thank u! Had to listen on 0.0.0.0
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
"web: python bot/main2.py" in my profile
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
python bot/main2.py
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
says its running, but when i go to my railway URL its down
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
weird cuz this is my logs now
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
2023-10-25 21:23:05,028 - telegram.ext.Application - INFO - Application started INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:80 (Press CTRL+C to quit)
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
https:// vizion-production.up.railway.app
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
its an env variable, set at 80
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
webserver = uvicorn.Server( config=uvicorn.Config( app=starlette_app, port=PORT, use_colors=False, log_level='info' #host="0.0.0.0", ) ) # Run application and webserver together async with application: await application.start() await webserver.serve() await application.stop() if name == "main": asyncio.run(init_db()) asyncio.run(main())
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
async def main() -> None: """Set up PTB application and a web application for handling the incoming requests.""" context_types = ContextTypes(context=CustomContext) # Here we set updater to None because we want our custom webhook server to handle the updates # and hence we don't need an Updater instance application = ( Application.builder().token(TOKEN).updater(None).context_types(context_types).build() ) # register handlers application.add_handler(CommandHandler("start", start)) application.add_handler(CommandHandler("add", add)) application.add_handler(TypeHandler(type=WebhookUpdate, callback=webhook_update)) # Pass webhook settings to telegram await application.bot.set_webhook(url=f"{URL}/telegram", allowed_updates=Update.ALL_TYPES) # Set up webserver async def telegram(request: Request) -> Response: """Handle incoming Telegram updates by putting them into the update_queue""" await application.update_queue.put( Update.de_json(data=await request.json(), bot=application.bot) ) return Response() async def custom_updates(request: Request) -> PlainTextResponse: data = await request.json() await application.updatequeue.put(WebhookUpdate(data=data)) return PlainTextResponse("Thank you for the submission! It's being forwarded.") async def health(: Request) -> PlainTextResponse: """For the health endpoint, reply with a simple plain text message.""" return PlainTextResponse(content="The bot is still running fine :)") starlette_app = Starlette( routes=[ Route("/telegram", telegram, methods=["POST"]), Route("/healthcheck", health, methods=["GET"]), Route("/helius", custom_updates, methods=["POST", "GET"]), ] )
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
I see. Well ive tried a bunch of stuff and cant find any updated examples on the internet for hosting a python telegram bot on railway. Posting my server setup code here if anyone has ideas.
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
It works locally tho. Must be an issue with HTTP/ports/webhooks/etc.
28 replies
RRailway
Created by Billy on 10/23/2023 in #✋|help
Python Telegram Bot Webhooks Error
28 replies