Skip to content

Commit

Permalink
Merge pull request #6 from district0x/fix_deployment
Browse files Browse the repository at this point in the history
Apply changes from debug branch
  • Loading branch information
sm47916 committed Jun 19, 2023
2 parents b8c6c22 + 9153e2b commit 1970a36
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ jobs:
platforms: linux/amd64,linux/arm64
file: docker/Dockerfile.${{ matrix.image }}
push: true
tags: ${{ secrets.ECR_REGISTRY }}/discord-py-bots:${{ matrix.image }}-latest
tags: ${{ secrets.ECR_REGISTRY }}/discord-${{ matrix.image }}:latest
10 changes: 5 additions & 5 deletions namebazaarBot/namebazaarBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
stream_channel_id = int(os.getenv('STREAM_CHANNEL_ID'))
stream_interval = int(os.getenv('STREAM_INTERVAL'))
eth_price_cache_expire = 300 # seconds

db_path = os.getenv('SQLITE_DB_PATH')
contract_addresses = { # Make sure addresses are checksum format
"mainnet": {
"ETHRegistrarController": "0x253553366Da8546fC250F225fe3d25d0C782303b",
Expand Down Expand Up @@ -95,8 +95,8 @@
intents.message_content = True
intents.members = True

tx_db = TxDB('nb.db')
user_address_db = UserAddressDB('nb.db')
tx_db = TxDB(db_path)
user_address_db = UserAddressDB(db_path)
bot = Client(intents=intents)

tx_link_instruction_text = f"please click on the link above. Upon clicking, the URL will open in your browser, " \
Expand Down Expand Up @@ -2090,7 +2090,7 @@ async def user_post():
tx_key = json_data["txKey"]
tx_result = json_data["txResult"]

if not tx_key or not tx_result or not tx_db.tx_key_exists(tx_key):
if not tx_key or not tx_result and not tx_db.tx_key_exists(tx_key):
abort(400, description='Transaction key is invalid')

if tx_db.tx_result_exists(tx_key):
Expand Down Expand Up @@ -2126,7 +2126,7 @@ async def user_post():
async def main():
nest_asyncio.apply()
tasks = [
asyncio.create_task(app.run_task(host="localhost", port=server_port)),
asyncio.create_task(app.run_task(host="0.0.0.0", port="80")),
asyncio.create_task(bot.start(namebazaarGPT_token))
]
await asyncio.gather(*tasks)
Expand Down
26 changes: 14 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@ aiosignal==1.3.1
async-timeout==4.0.2
attrs==22.2.0
charset-normalizer==3.1.0
discord==2.2.2
discord-py-interactions~=5.1.0
discord-typings==0.5.1
discord.py==2.2.2
discord==2.2.2
distlib==0.3.6
ens-normalize~=2.0.0
filelock==3.11.0
frozenlist==1.3.3
httpx_cache~=0.10.0
httpx~=0.24.0
idna==3.4
multidict==6.0.4
nest_asyncio
openai~=0.27.4
packaging==23.0
pinecone-client~=2.2.1
pkgconfig==1.5.5
platformdirs==3.2.0
psutil==5.9.4
virtualenv==20.21.0
virtualfish==2.5.5
yarl==1.8.2
openai~=0.27.4
pinecone-client~=2.2.1
discord-py-interactions~=5.1.0
web3~=6.2.0
ens-normalize~=2.0.0
pycryptodome~=3.17
python-dotenv~=1.0.0
quart~=0.18.4
quart-cors~=0.6.0
httpx~=0.24.0
httpx_cache~=0.10.0
quart~=0.18.4
virtualenv==20.21.0
virtualfish==2.5.5
web3~=6.2.0
yarl==1.8.2

0 comments on commit 1970a36

Please sign in to comment.