データベースへの接続バグを修正
This commit is contained in:
parent
22bc5fe240
commit
a81327a680
1 changed files with 3 additions and 3 deletions
|
@ -42,8 +42,8 @@ class Database():
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
class Bot(discord.Client):
|
class Bot(discord.Client):
|
||||||
def db_connect(self, host, db, user, password):
|
def db_connect(self, host, db, port, user, password):
|
||||||
self.db = psycopg2.connect(f"host={host} dbname={db} user={user} password={password}")
|
self.db = psycopg2.connect(f"host={host} dbname={db} port={port} user={user} password={password}")
|
||||||
|
|
||||||
async def on_ready(self):
|
async def on_ready(self):
|
||||||
print("ログイン成功")
|
print("ログイン成功")
|
||||||
|
@ -148,5 +148,5 @@ intents = discord.Intents.default()
|
||||||
intents.message_content = True
|
intents.message_content = True
|
||||||
|
|
||||||
bot = Bot(intents=intents)
|
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"])
|
bot.run(bot_config["token"])
|
Loading…
Reference in a new issue