Skip to content

Commit

Permalink
Apply changes from debug branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sm47916 committed Jun 19, 2023
1 parent b8c6c22 commit 2005d7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 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

0 comments on commit 2005d7c

Please sign in to comment.