From 2853910caf568379e79e2cd9925bb1f8d0c84a1e Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 16 Aug 2018 14:17:27 -0400 Subject: [PATCH] better path? --- chatter/chat.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/chatter/chat.py b/chatter/chat.py index eca1056..c4939d5 100644 --- a/chatter/chat.py +++ b/chatter/chat.py @@ -1,4 +1,5 @@ import asyncio +import pathlib from datetime import datetime, timedelta import discord @@ -7,7 +8,7 @@ from redbot.core import commands from chatter.chatterbot import ChatBot from chatter.chatterbot.trainers import ListTrainer - +from redbot.core.data_manager import cog_data_path class Chatter: """ @@ -22,11 +23,13 @@ class Chatter: "whitelist": None, "days": 1 } + path: pathlib.Path = cog_data_path(self) + data_path = path / ("database.sqlite3") self.chatbot = ChatBot( "ChatterBot", storage_adapter='chatter.chatterbot.storage.SQLStorageAdapter', - database='./database.sqlite3' + database=data_path ) self.chatbot.set_trainer(ListTrainer)