Closed ogigio closed 9 months ago
Try updating interactions.py using pip install -U discord-py-interactions
says already satisfied
You might have another Python package installed that also uses the module name interactions
, try setting up a virtual environment
wdym, virtual environment
wdym, virtual environment
https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/
i've done that and it's still same error
Make sure you activate the venv and install the packages + run the bot inside the venv
wait so i did run venv by doing something in shell(i am using replit) i need to install packages again? And if yes how should i do it, btw do you have discord or smth so we could chat if u want to help?
Yep, it should say (venv) when you activate the virtual environment. If you still need help my Discord is @aelew
Apparently this is an issue with Replit guessing and automatically installing the wrong packages based on import names.
Here's how you can fix this:
Create a fresh Replit project using the GitHub repo URL
Turn on show hidden files
Open .replit
and add disableGuessImports = true
to the top of the file
Manually install packages using pip install -r requirements.txt
Set your environment variables using Replit's Secrets tool (see the .env.example
file to see what you need)
Run the bot using the run button
Hope this helps! You should not need a virtual environment anymore. I'll probably look into adding a Replit deploy button when I have some free time.
"Create a fresh Replit project using the GitHub repo URL" Do i just download all files and upload there or is there easier way?
Here is a video to help you :) https://github.com/aelew/cryptotracker/assets/118043566/c14452a7-719b-4d07-9a72-a6a0aa4b76c2
how did bro make that so fast...
Well i got this now, i put token in env.example file and i tried with "" and without since idk if i should or shouldnt add them btw what's web3_http_provider and where to get that
Traceback (most recent call last):
File "/home/runner/cryptotracker/main.py", line 131, in
Since you're using Replit, you need to use their Secrets tool to set your environment variables. For WEB3_HTTP_PROVIDER
, you can create an Ethereum endpoint at https://www.quicknode.com and use the HTTP Provider URL it gives you. If you don't need ETH support, you don't need this variable.
Damn this works, ty for this kind of support, tbh i never saw better developer (that posts on github), you know how to make shit and how to help others, ty brother!
No problem! Let me know if you have any other questions 😉
Yo now if i wanna host 24/7 with uptimerobot i can just add my keep_alive.py? It won't mess up something?
from flask import Flask from threading import Thread import random
app = Flask('')
@app.route('/') def home(): return 'Im in!'
def run(): app.run( host='0.0.0.0', port=random.randint(2000,9000) )
def keep_alive(): ''' Creates and starts new thread that runs the function run. ''' t = Thread(target=run) t.start()
You can try, no guarantees it'll work though. I'm afraid I can't help with that if it doesn't. If you're a student, Heroku offers credits via the GitHub Student Developer Pack that can host the bot for free for a whole year, which is what I'm currently doing with the hosted version.
Came back to thank you again for this source code, my bot is now in 134 servers and i am waiting for verification of it!
Update on keep_alive: yea it worked, it's hosted 24/7 for free
Question: How could i add multiple checking because some sites with crypto as payment method has checking with more blockchain type of sites like blockchair, blockchain etc. and it says 1/2 confirmations but my bot pinged me bc it confirmed 1/1 for it
Traceback (most recent call last): File "/home/runner/blockchain/main.py", line 5, in
from interactions import (listen, slash_command, Activity, ActivityType, OptionType, SlashContext, SlashCommandChoice,
ImportError: cannot import name 'listen' from 'interactions' (/home/runner/blockchain/.pythonlibs/lib/python3.10/site-packages/interactions/init.py)
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7ffabfa6ca60>