Skip to content

Chatterbot on nextcord(discord.py) not create db.sqlite3 #2238

Open
@Ghieh44

Description

@Ghieh44

Hello, I'm creating a chatterbot with this library in nextcord to use in discord and it works, but it doesn't create the "db.sqlite3" file that makes possible to learn new words and I'm trying to solve this bug, in case anyone have an idea of solving this problem, I would like to comment here.

if i resolve, i'll tell how i did it

The code:

#imports
import nextcord
from nextcord.ext import commands
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer

#variable
bot = commands.Bot(command_prefix='$', activity=nextcord.Game(name='!co pra falar comigo!'))
chatbot = ChatBot('Cobaia')

#conversation list
conversation = [
    'Ola',
    'Ola, tudo bem?',
    'Tudo e você?',
    'Estou bem',
    'Faz o que de bom?',
    'Conversando',
    'Você gosta de comida?',
    'Sim, eu amo comer e você?',
    'Eu também'
]

#chatterbot train
trainer = ListTrainer(chatbot)
trainer.train(conversation)

#bot online warning
@bot.event
async def on_ready():
    print(f'Ola mestre! me loguei como {bot.user}')

#chatterbot command
@bot.event
async def on_message(message):
    if message.author == bot.user:
        return

    if message.content.startswith('!co'):
        response = chatbot.get_response('')
        await message.channel.send(response)

#run
bot.run('token')

I'm not good in english, but i understand if you write in english

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions