Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suport PostgreSql #14

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
BOT_TOKEN='TOKEN_HERE'
BOT_PREFIX=!
BOT_ACTIVITY='Palworld'
BOT_LANGUAGE='en'
BOT_LANGUAGE='en'

#change with the data of your PostgreSql Database
BOT_POSTGRESQL_STRING_CONNECTION='postgresql://username:password@localhost:port'

# Use this way if you do not intend to use a database
BOT_POSTGRESQL_STRING_CONNECTION=''
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.db
*.log

/.vs/*
/dev/*
/venv/*
!gamedata/*.json
Expand Down
9 changes: 5 additions & 4 deletions cogs/economy/shop.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
server_autocomplete,
)
from utils.rconutility import RconUtility
from utils.kitutility import load_shop_items
from utils.kitutility import init_kitdb,load_shop_items
import asyncio
import utils.constants as constants
import json
from utils.translations import t
from utils.errorhandling import restrict_command
import logging

class ShopView(View):
def __init__(self, shop_items, currency, cog, selected_server):
class ShopView(View):
def __init__(self, shop_items, currency, cog, selected_server):
super().__init__(timeout=None)
self.shop_items = shop_items
self.currency = currency
Expand Down Expand Up @@ -95,7 +95,8 @@ async def next_button_callback(self, interaction: nextcord.Interaction):
class ShopCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.bot.loop.create_task(self.load_config())
self.bot.loop.create_task(init_kitdb())
self.bot.loop.create_task(self.load_config())
self.bot.loop.create_task(self.load_economy())
self.bot.loop.create_task(self.reload_cache())
self.rcon_util = RconUtility()
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ gamercon-async==1.0.6
aiohttp==3.10.10
aiosqlite==0.20.0
pytz==2024.2
steam==1.4.4
steam==1.4.4
psycopg2-binary==2.9.6
Loading