UNPKG

@nicat.dcw/notes

Version:

📦📝 Hızlı Not Sistemi Modülü

26 lines (24 loc) 1.06 kB
const ms = require("ms") const moment = require("moment") moment.locale("tr") const data = require("resydb") const db = new data.JsonDB("../database.json") module.exports = async ({not, customFetch}) => { try { if(!not) throw new TypeError("Lütfen Bir Not Ismi giriniz!") const findData = db.get(`note.${not}`) || "Veri Bulunamadı." if(!findData) return `[HATA] "${not}" isimli bir not bulunamadı!.` if(customFetch === "deaktif"){ const mesaj = ` • Not Ismi: ${not}\n • Oluşturulma Tarihi: ${moment(findData.tarih).format("LLL") || "Bulunamadı!"}\n • Bildirim Zamanı: ${findData.bildirim || "kapalı."}` return mesaj; }else if(customFetch === "aktif"){ // findData.replace("bildirim:", "") //if(findData.bildirim === null) return `[HATA] Belirtilen Veri Bulunamadı!.` // if(findData.bildirim === undefined) return `[HATA] Belirtilen Veri Bulunamadı!.` return findData || "Veri Bulunamadı." } } catch (err) { throw new TypeError("[HATA] Veri Bulunurken bir hata oluştu!") //return; } }