Home > Software design >  Heroku Failed Push
Heroku Failed Push

Time:11-21

I'm trying to push something towards heroku with the command: "git push heroku HEAD:main"

The error i get inside of the CMD is:

    "! [remote rejected] HEAD -> main (pre-receive hook declined)
      error: failed to push some refs to 'https://git.heroku.com/discordbotonline247.git'"
    
     And if i check Heroku logs i find this:
    -----> Building on the Heroku-20 stack
    
    -----> Using buildpack: heroku/python
    
    -----> Python app detected
    
    -----> No Python version was specified. Using the buildpack default: python-3.9.9
    
           To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes
    
    -----> Installing python-3.9.9
    
    -----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
    
    -----> Installing SQLite3
    
    -----> Installing requirements with pip
    
           Collecting git https://github.com/Rapptz/discord.py@rewrite (from -r /tmp/build_3181f09c/requirements.txt (line 1))
    
             Cloning https://github.com/Rapptz/discord.py (to revision rewrite) to /tmp/pip-req-build-wpl2aq36
    
             Running command git clone --filter=blob:none -q https://github.com/Rapptz/discord.py /tmp/pip-req-build-wpl2aq36
    
             WARNING: Did not find branch or tag 'rewrite', assuming revision or ref.
    
             Running command git checkout -q rewrite
    
             error: pathspec 'rewrite' did not match any file(s) known to git
    
           WARNING: Discarding git https://github.com/Rapptz/discord.py@rewrite. Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
    
           ERROR: Command errored out with exit status 1: git checkout -q rewrite Check the logs for full command output.
    
     !     Push rejected, failed to compile Python app.
    
     !     Push failed

in my Procfile i have:

"worker: python Discord_Bot.py

In my requirements.txt i have:

"git https://github.com/Rapptz/discord.py@rewrite
 PyNaCl==1.3.0
 pandas
 dnspython==1.16.0
 async-timeout==3.0.1"

Please help!

CodePudding user response:

You need to remove the quotation marks in your requirement.txt file along with the @rewrite in the Github link. However, instead of removing the @rewrite, just specify the discord version. Replace your requirements.txt file with the following:

discord.py==1.6.0
PyNaCl==1.3.0
pandas
dnspython==1.16.0
async-timeout==3.0.1

CodePudding user response:

TYSM, i got it up and running now.

Question, do you know how to change URL through discord bot

So to explain it a bit more, i have a link. For example: https://Test.com/1/Test and i want the "1" to change on command cause it gives me the output through a .txt that the bot puts in as a message in the discord channel

so for example if i do .New then it changes the "1" in the origional link to the new one and from their prints the output through the .txt I allready have a API for it i just need to know how to do this with a discord bot. I allready made it work with just the Python Console by this code:

1 = input("")
loc = print (get('https://Test.com/'   (1)  '/json/').text)

but then with the acctual site name Ofcource but i dont know if it is going to block it then

  • Related