flash / Database /mongodb /whispers.py
Karma
Add files via upload
c7dfe8b
raw
history blame
579 Bytes
from Database.mongodb.db import dbname
collection = dbname["whisper"]
class Whispers:
@staticmethod
async def add_whisper(WhisperId, WhisperData):
whisper = {"WhisperId": WhisperId, "whisperData": WhisperData}
await collection.insert_one(whisper)
@staticmethod
async def del_whisper(WhisperId):
await collection.delete_one({"WhisperId": WhisperId})
@staticmethod
async def get_whisper(WhisperId):
whisper = await collection.find_one({"WhisperId": WhisperId})
return whisper["whisperData"] if whisper else None