Created
October 13, 2021 11:54
-
-
Save BruceCodesGithub/ef9d4830cddf1339e2ce53c07d80a901 to your computer and use it in GitHub Desktop.
AIOSQLITE with Discord Bots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
import aiosqlite, asyncio | |
async def setup(): | |
bot.db = await aiosqlite.connect("storage/bot.db") | |
await bot.db.execute("CREATE TABLE IF NOT EXISTS mytable (column1, column2)") | |
await bot.db.commit() | |
bot = commands.Bot( | |
command_prefix="!", | |
) | |
asyncio.get_event_loop().run_until_complete(setup()) | |
bot.run("TOKEN") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment