データベースへの接続バグを修正

This commit is contained in:
suti7yk5032 2024-06-05 11:27:57 +09:00
parent 22bc5fe240
commit a81327a680

View file

@ -42,8 +42,8 @@ class Database():
return 0
class Bot(discord.Client):
def db_connect(self, host, db, user, password):
self.db = psycopg2.connect(f"host={host} dbname={db} user={user} password={password}")
def db_connect(self, host, db, port, user, password):
self.db = psycopg2.connect(f"host={host} dbname={db} port={port} user={user} password={password}")
async def on_ready(self):
print("ログイン成功")
@ -148,5 +148,5 @@ intents = discord.Intents.default()
intents.message_content = True
bot = Bot(intents=intents)
bot.db_connect(db_config["host"], db_config["db"], db_config["username"], db_config["password"])
bot.db_connect(db_config["host"], db_config["db"], db_config["port"], db_config["username"], db_config["password"])
bot.run(bot_config["token"])