前提・実現したいこと
DiscordでRPGボットを作っているのですが、Sqlite3にテーブルを追加しても見つからないと出てきます。
発生している問題・エラーメッセージ
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OperationalError: no such table: テーブル名
テーブルを追加したときのコードです(すべてのテーブルが存在しないといわれます)
py
1 con = sqlite3.connect('mmo.db', isolation_level=None) 2 cursor = con.cursor() 3 cursor.execute("CREATE TABLE player(user_id INTEGER, experience INTEGER)"); 4 cursor.execute("CREATE TABLE channel_status(channel_id INTEGER, boss_level INTEGER, boss_hp INTEGER)"); 5 cursor.execute("CREATE TABLE in_battle(channel_id INTEGER, user_id INTEGER, player_hp INTEGER)"); 6 cursor.execute("CREATE TABLE training(user_id INTEGER, training_question INTEGER)"); 7 cursor.execute("CREATE TABLE channel_in_transaction(channel_id INTEGER)"); 8 cursor.execute("CREATE TABLE item(user_id INTEGER, item_id INTEGER, count INTEGER)"); 9 con.commit()
以下のgithubコードをcloneして実行しています
https://github.com/yhay81/mmokun/blob/master/mmo.py
Discord.pyのバージョン、必要なjsonなどはすべてちゃんとそろっています
あなたの回答
tips
プレビュー