freiheit / discord_feedbot

Moved to https://gitlab.com/ffreiheit/discord_feedbot
MIT License
82 stars 28 forks source link

Procfile for deployment on heroku? #51

Closed Bewinxed closed 7 years ago

Bewinxed commented 7 years ago

Hello, I'm trying to deploy this on heroku but it needs a procfile and i can't figure it out :(

freiheit commented 7 years ago

I don't know heroku at all, but I'm definitely willing to help figure this out, and wouldn't mind adding the files needed into my repository.

On Sat, Mar 11, 2017 at 4:30 AM Bewinxed notifications@github.com wrote:

Hello, I'm trying to deploy this on heroku but it needs a procfile and i can't figure it out :(

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/freiheit/discord_feedbot/issues/51, or mute the thread https://github.com/notifications/unsubscribe-auth/AABNZVn5ynYBgD2FXNfbhQjXRWafgvAJks5rkpPwgaJpZM4MaMPC .

freiheit commented 7 years ago

Please try out what I have on the heroku branch now. And let me know how it goes.

You can use git checkout --track origin/heroku to switch to it.

Bewinxed commented 7 years ago

I was able to push it to Heroku (A platform for hosting code online in multiple languages) It built and pushed, now i checked the logs and it keeps crashing and giving the following

State changed from crashed to starting Starting process with command python feed2discord.py State changed from starting to up Process exited with status 0 WARNING:discord.client:PyNaCl is not installed, voice will NOT be supported INFO:main:ednews: Starting up background_check_feed INFO:main:discordreddit: Starting up background_check_feed INFO:main:galnet: Starting up background_check_feed INFO:main:gazelle: Starting up background_check_feed sys:1: ResourceWarning: unclosed <socket.socket fd=8, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.16.167.238', 40021), raddr=('104.16.59.5', 443)> /app/.heroku/python/lib/python3.6/asyncio/selector_events.py:631: ResourceWarning: unclosed transport <_SelectorSocketTransport fd=8> source=self) /app/.heroku/python/lib/python3.6/site-packages/aiohttp/client.py:88: ResourceWarning: Unclosed client session <aiohttp.client.ClientSession object at 0x7f75608ffdd8> ERROR:asyncio:Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x7f75608ffdd8> ERROR:asyncio:Task was destroyed but it is pending! task: <Task pending coro=<background_check_feed() running at feed2discord.py:360> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f7560855708>()]>> ERROR:asyncio:Task was destroyed but it is pending! task: <Task pending coro=<background_check_feed() running at feed2discord.py:360> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f7560855768>()]>> ERROR:asyncio:Task was destroyed but it is pending! task: <Task pending coro=<background_check_feed() running at feed2discord.py:360> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f7560855858>()]>> ERROR:asyncio:Task was destroyed but it is pending! task: <Task pending coro=<background_check_feed() running at feed2discord.py:360> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f75608558b8>()]>> State changed from up to crashed

Bewinxed commented 7 years ago

I'm using this RSS feed http://feeds.feedburner.com/surrenderat20/CqWw

freiheit commented 7 years ago

The output looks like it's using the example .ini file, not yours...

Copy feed2discord.ini to feed2discord.local.ini, make sure the only feed and room in there is what you want, and make sure your bot's auth token is in there.

Bewinxed commented 7 years ago

I have already added my changes in the local.ini thing, i think i should've deleted the first one and the example one and left the local one :)

After lots of tampering i found that the async error was because i didn't reference the correct channel in the feed (only one channel named "one" but the feed was set to "two" and that threw the error.

And for some reason git kept ignoring the local ini from pushing it to the heroku git! freaky!

i'm inexperience with git but i figured it out, now it seems to be running =)

Last question!

is there a way to send a test command to force the bot to push the latest post from the RSS feed? (maybe by PMing the bot with the command?)

the "show_all_entries.py" doesn't work for me (If i type a URL it says invalid syntax, if i put the URL in quotes it just returns the same URL with nothing else)

freiheit commented 7 years ago

Shouldn't need to delete the original .ini file; if the bot finds a .local.ini file it will prefer that.

There's a line in .gitignore that causes the .local.ini file to be ignored, because I'm trying to discourage people from pushing their bot's login credentials into public git repositories.

Since this seems to have worked, I've merged this into the main code, so you can switch the the "master" branch.

No way to send any test commands to the bot right now. This bot is purely write-only and doesn't read anything in any rooms or listen to any commands. You can set start_skew to 1 and restart the bot to get it to immediately process a feed.

I'd have to see more details about the show_all_entries.py problem. Try python3 show_all_entries.py http://...