File size: 818 Bytes
ca4eb6d
 
 
 
 
11ae35a
ca4eb6d
 
 
 
 
 
 
 
89a7a7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
async def all_plugins():
    # This generates a list of plugins in this folder for the * in __main__ to
    # work.

    from glob import glob
    from os.path import basename, dirname, isfile

    mod_paths = glob(dirname(__file__) + "/*.py")
    all_plugs = [
        basename(f)[:-3]
        for f in mod_paths
        if isfile(f) and f.endswith(".py") and not f.endswith("__init__.py")
    ]
    return sorted(all_plugs)

from sys import exit as exiter

from pymongo import MongoClient
from pymongo.errors import PyMongoError

from Powers import BDB_URI, LOGGER

try:
    BIRTHDAY_DB = MongoClient(BDB_URI)
except PyMongoError as f:
    LOGGER.error(f"Error in Mongodb2: {f}")
    exiter(1)
Birth_main_db = BIRTHDAY_DB["birthdays"]

bday_info = Birth_main_db['users_bday']
bday_cinfo = Birth_main_db["chat_bday"]