'why doesn't my db.autosave function work discord.py?
There is a part in my code that just doesn't work for me. Does anybody know any good solution for this?
from discord import Embed, File
from discord import Intents
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from discord.ext.commands import Bot as BotBase
from datetime import datetime
from discord.ext.commands import CommandNotFound
import db
from apscheduler.triggers.cron import CronTrigger
PREFIX = "+"
OWNER_IDS = [436163963894366209]
class Bot(BotBase):
def __init__(self):
self.PREFIX = PREFIX
self.ready = False
self.guild = None
self.scheduler = AsyncIOScheduler()
db.autosave(self.scheduler)
super().__init__(
command_prefix = PREFIX,
owner_ids = OWNER_IDS,
itnets = Intents.all()
)
Console output:
File "c:\Users\cuz i can\Downloads\DiscordBottie\lib\bot\__init__.py", line 21, in __init__
db.autosave(self.scheduler)
AttributeError: module 'db' has no attribute 'autosave'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
