IGLADI / Ethereal-Hyperspace-Battleships

8 stars 0 forks source link

50 feature trading system #70

Closed IGLADI closed 8 months ago

IGLADI commented 8 months ago

Description[^1]

issue: Add trading for resources #50

Modifications[^2]

moved /pay to trade_cog.py

Additions[^3]

Added /give_resources & /trade

Additional remarks[^4]

The trading is implemented with discord buttons and everything (discord modal paginators), the UI dev will still need to print nice messages with tabulate

[^1]: Description of the pull request. [^2]: Modifications, commands modified and explanation. [^3]: Files added, commands added and explanation. [^4]: Additional remarks (e. a. documentation needs to be updated)

LordTlasT commented 8 months ago

I added implementation of database, but I couldn't get the ui/trade_menu.py to work properly. Could you please fix this for me?

LordTlasT commented 8 months ago

Still need to do:

IGLADI commented 8 months ago

use constants instead of hardcoded values (modal[0]

U sure that's the right branch? didn't find that

update the requirements.txt file

done

integrate with database

done

LordTlasT commented 8 months ago

U sure that's the right branch? didn't find that

search for [0], it's modals and uppermodals, but there may be more

I will review the rest

IGLADI commented 8 months ago

search for [0], it's modals and uppermodals, but there may be more

yup mb, was resolved in another branch so I completly forgot it here

LordTlasT commented 8 months ago

remove the prints -> async def trade

LordTlasT commented 8 months ago

change to if and if

        if amount < 0:
            if recipient_player.money < abs(amount):
                await interaction.response.send_message(
                    "The recipient doesn't have enough money to send.", ephemeral=True
                )
                return
        else:
            if sender.money < abs(amount):
                await interaction.response.send_message("You don't have enough money to send.", ephemeral=True)
                return
LordTlasT commented 8 months ago

remove welcome_ui.py and move ui to src/ Afterwards I will test

LordTlasT commented 8 months ago

I cannot /mine after registering, error in register logic ? conflict with check_player_exists

IGLADI commented 8 months ago

This is implemented in #83 will close this one.