{"_id":"discord-birthday","_rev":"32-d3014241bb149ab05ce5f0df351d0d7c","time":{"created":"2022-07-27T21:37:07.723Z","0.0.1":"2022-07-24T17:24:29.535Z","modified":"2022-08-20T12:41:30.126Z","0.0.2":"2022-07-24T17:46:03.707Z","1.0.1":"2022-07-25T19:10:24.455Z","1.0.3":"2022-07-25T19:56:04.967Z","1.0.4":"2022-07-25T20:45:06.346Z","1.0.5":"2022-07-25T20:48:23.629Z","1.0.6":"2022-07-25T20:49:56.537Z","1.0.0":"2022-07-25T20:53:27.711Z","1.1.0":"2022-07-26T11:03:15.826Z","1.1.1":"2022-07-26T11:07:52.820Z","1.1.2":"2022-07-26T11:48:43.436Z","1.1.3":"2022-07-26T12:10:06.110Z","1.1.43":"2022-07-26T13:11:25.301Z","1.1.5":"2022-07-26T13:47:06.080Z","1.2.0":"2022-07-27T21:37:07.861Z","1.2.1":"2022-07-27T21:45:05.773Z","1.2.2":"2022-07-27T22:06:53.706Z","1.2.3":"2022-08-20T12:41:30.054Z"},"name":"discord-birthday","dist-tags":{"latest":"1.2.3"},"versions":{"1.2.2":{"name":"discord-birthday","version":"1.2.2","description":"discord-birthday is a powerful package that allows you to create a birthday system on your discord bot easily and quickly.","main":"dist/index.js","scripts":{"test":"exit 0"},"types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"require":"./dist/index.js"},"./src/*":"./dist/*","./dist/*":"./dist/*"},"repository":{"type":"git","url":"git+https://github.com/AyrozDZN/discord-birthday.git"},"keywords":["Discord","Birthday","Cron","Timezone","Events","fs"],"author":{"name":"AyrozDZN"},"license":"MIT","bugs":{"url":"https://github.com/AyrozDZN/discord-birthday/issues"},"homepage":"https://github.com/AyrozDZN/discord-birthday#readme","devDependencies":{"discord.js":"^14.0.3","typescript":"^4.7.4"},"dependencies":{"events":"^3.3.0","fs":"^0.0.1-security","node-cron":"^3.0.1"},"gitHead":"56010f790b921af7aa672ea365cd96cd3663e212","_id":"discord-birthday@1.2.2","_nodeVersion":"17.1.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-YkG85zWsFEVKg2mme939xKW/VoD39wSCeK3eTwfKZiI20YtdDJ6wGzKbpE0+hRBoCQI35CtrAc5QQIeNYjmKMA==","shasum":"a83f14059691e2f046496d73f65e4bd525fdbc48","tarball":"https://registry.npmjs.org/discord-birthday/-/discord-birthday-1.2.2.tgz","fileCount":9,"unpackedSize":67167,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIERhiROjObGIvL2UwoynmgOZ6Qt/3rKll1dTno1Yy/zzAiB7bORSSgY4eXw1cYQk27dDA4ebZBfiBVTpnHOWvS77aA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4bb9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMIA//WO0BjODzJ6YFKUTtFDdA/KpG8Fc5pxDBViAzCMDZJ0VaM7FM\r\nVZhonugQBablFwsNXDpw/pYE0ut6/c9qsb6BCmFIOtntuxOmrGXLJ0OtMhRx\r\n6thIJXVsaw5+AJhaRl+P+45FI3Eagzx1es0JEQsW4KoLKlGFg76yWcpgtb97\r\nhxI8c6w+pBGE4dm18U1nlSiHZp3V67ljBKar9qGSNMBl1+vlKq4zcYInWkhr\r\n1DIr3Um64+YGziTfBvZbcm19UNKISHAUzntmMHn8jeFQYIwjM5MWDDM+W7wt\r\n9aYTZxyKMP5zomcaxGg6yPKaoRxd16CWuS0B7uq8aWCmOHb6m2n6MmdLtgcQ\r\n5MLx/Bca2ZBkgO/8HSvUSXnralfFHdmlaV8/ksIMWU1oDpe0PGBw3NRwx3FF\r\nI8Rglu/BOgVp+5KGku/+F8gEM4UEAI6KsTBaGpOz771/67U1i8wPCclpeBqB\r\nIHQKU/1iichA75xiAKDZUrgoxP1RseMygXH+wJlAlfoW6cRSj8V+KZTnEHZc\r\nb/ATfrAFVVyncKFHNRgIcKtleokVNkSlDuJ446aRt1zfyK3CsAldYC7KPT+m\r\nvrCNfqSjdCOWM3+WZEjVf6x5RAabaBPFrMl78DF3s1EKxvc6FMUXxTV7ieTM\r\nR9doZhlgQSe7rRTL5dp2fEfkEn7QmpvLOf8=\r\n=hcOm\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ayrozdzn","email":"thibaut53.breton@gmail.com"},"directories":{},"maintainers":[{"name":"ayrozdzn","email":"thibaut53.breton@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/discord-birthday_1.2.2_1658959613465_0.6196068328140265"},"_hasShrinkwrap":false},"1.2.3":{"name":"discord-birthday","version":"1.2.3","description":"discord-birthday is a powerful package that allows you to create a birthday system on your discord bot easily and quickly.","main":"dist/index.js","scripts":{"test":"exit 0"},"types":"dist/index.d.ts","module":"dist/index.mjs","exports":{".":{"require":"./dist/index.js"},"./src/*":"./dist/*","./dist/*":"./dist/*"},"repository":{"type":"git","url":"git+https://github.com/AyrozDZN/discord-birthday.git"},"keywords":["Discord","Birthday","Cron","Timezone","Events","fs"],"author":{"name":"AyrozDZN"},"license":"MIT","bugs":{"url":"https://github.com/AyrozDZN/discord-birthday/issues"},"homepage":"https://github.com/AyrozDZN/discord-birthday#readme","devDependencies":{"discord.js":"^14.0.3","typescript":"^4.7.4"},"dependencies":{"events":"^3.3.0","fs":"^0.0.1-security","node-cron":"^3.0.1","tslib":"^2.4.0"},"gitHead":"56010f790b921af7aa672ea365cd96cd3663e212","_id":"discord-birthday@1.2.3","_nodeVersion":"17.1.0","_npmVersion":"8.18.0","dist":{"integrity":"sha512-5UDukiSV3M5BqatAYIlhqdLRd21O7pFEjSkhpGqq2v87Cot9Q74e5FtAB4G2mHxKsL/d/gTFa2IfjI796VsnQw==","shasum":"af7977a34158623a17b84d9dbb3c554e808c92b7","tarball":"https://registry.npmjs.org/discord-birthday/-/discord-birthday-1.2.3.tgz","fileCount":9,"unpackedSize":67190,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEj/yH7y5GBJrCzTRiKgIkx5j03wXAEjWFTUjJ7IpBOhAiEAyu13YmZHLnxsG+wWmUUP3QOeSQX1AhiD4Sk1shExSy0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjANZ6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZyw/9GZ40CVu2uoba/HGlyE2Bxj02Q9vtwPLWPpHw2pJy5h7956iz\r\nCUBaLyxsM/cPIC45i3IsF8w9rswifa8TqJ7lY7nLnAhKQ2kdFhv6c+6tcmku\r\nU59jFrnEn9VsQA9zVC5doClknQf7h/oZtPCpbWjgAVzQVz1W53Xq+9TyEJff\r\nRrIg9FV8be4Xmc+jWvkqqWsahR4yVcyKdxnsKNDIQsbcGT9x4kHOTVXL6qS8\r\niZGCmbP+2SrlssdGctGGrGnTd2vsycUk4W8is6YlTVlrLE6MKffbOK1XmtFV\r\n5Ur0pPFdkjAyfLMqq11OfQ+3ZYVa8p66xWcfdbWXczmFolUdkNrbavRQJ3DY\r\nreGXzi3SkJjzgJ+IXSAjqNdue+lD1gLp9tOG8HbZ06UGSNUPE2aO3kOAcWLo\r\nHTweXOlWs5C7BzZ3UXKMoazQurv/p9t2/5sKkRYiffZqGcdtgRKh0awH2Wu6\r\nRX3Pm4+upZRFX74gSjPZobUIJrGy0ZKDCUvrae85qGXQ/deeT/9wkcUOnCqf\r\naAVY6ZxjSRFpuThpQOxsb+JhoP3tZyuuQ0skmPkh2UrKwdkNxEZsR13eLxIV\r\nwQQtyYkuVHHwpONVfC87qKuDNma6ivuBbyaqXJ2sUzrPoHg9JDnqjGacID02\r\namo+GfT6JuKcK4638M1DTghyFos1HOI2QTg=\r\n=7+34\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ayrozdzn","email":"thibaut53.breton@gmail.com"},"directories":{},"maintainers":[{"name":"ayrozdzn","email":"thibaut53.breton@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/discord-birthday_1.2.3_1660999289884_0.48945290140773356"},"_hasShrinkwrap":false}},"maintainers":[{"name":"ayrozdzn","email":"thibaut53.breton@gmail.com"}],"description":"discord-birthday is a powerful package that allows you to create a birthday system on your discord bot easily and quickly.","homepage":"https://github.com/AyrozDZN/discord-birthday#readme","keywords":["Discord","Birthday","Cron","Timezone","Events","fs"],"repository":{"type":"git","url":"git+https://github.com/AyrozDZN/discord-birthday.git"},"author":{"name":"AyrozDZN"},"bugs":{"url":"https://github.com/AyrozDZN/discord-birthday/issues"},"license":"MIT","readme":"# Discord Birthday\n![](https://img.shields.io/github/workflow/status/ayrozdzn/discord-birthday/Node.js%20CI?style=for-the-badge)\n![](https://img.shields.io/npm/v/discord-birthday?style=for-the-badge&color=success)\n![](https://img.shields.io/npm/dt/discord-birthday?style=for-the-badge)\n\ndiscord-birthday is a powerful package that allows you to create a **birthday system** on your **discord bot** _easily and quickly_.\n\n\n# Installation\n\n## Download package\n\n```sh-session\nnpm install discord-birthday\nnpm install @ayrozdzn/discord-birthday\nyarn add discord-birthday\n```\n\n\n## Connect to your discord bot\n\n```js\nconst { Birthday, Timezone } = require(\"discord-birthday\"); // or @ayrozdzn/discord-birthday\nconst { Client } = require(\"discord.js\");\n\nconst client = new Client({ ... });\n\nclient.birthday = new Birthday(client, {\n    timezone: Timezone.UTC,\n    hour: 10,\n    minute: 0,\n});\n```\n\n| Parameter | Type | Optional | Default | Description |\n|--|--|--|--|--|\n| client | [Client](https://discord.js.org/#/docs/discord.js/main/class/Client) |  |  | The discord client |\n| timezone | [Timezone](https://github.com/AyrozDZN/discord-birthday/blob/master/src/struct/timezone.ts) | ✓ | Timezone.UTC | Your timezone |\n| hour | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | ✓ | 10 | A number between 0 and 23 |\n| minute | [Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) | ✓ | 0 | A number between 0 and 59 |\n\n#  Methods\n\n## setUserBirthday\n\n```js\nclient.birthday.setUserBirthday(user, date, seeAge)\n```\n\n\n| Parameter | Type | Optional | Default | Description |\n|--|--|--|--|--|\n| user |  [User](https://discord.js.org/#/docs/discord.js/main/class/User)  | | | The user whose birthday is to be set |\n| date |  [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)  | | | The birthday date |\n| seeAge |  [Boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)  | ✓ | true | Set the visibility variable accessible after |\n\nreturns : [Birthday](https://github.com/AyrozDZN/discord-birthday/blob/master/src/index.ts)\n\n## getUserBirthday\n\n```js\nclient.birthday.getUserBirthday(user).then((birthday) => {\n    console.log(birthday)\n    /*\n    {\n        user: <User>,\n        seeAge: <Boolean>,\n        date: <Date>,\n        age: <Number>,\n        nextBirthday: <Date>,\n        daysBeforeNext: <Number>,\n        guilds: <Array<Guild>>,\n    }\n    */\n}).catch((err) => console.error(err));\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| user | [User](https://discord.js.org/#/docs/discord.js/main/class/User) | The user whose birthday is to be collected |\n\nreturns : [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>\n\n## deleteUserBirthday\n\n```js\nclient.birthday.deleteUserBirthday(user)\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| user | [User](https://discord.js.org/#/docs/discord.js/main/class/User) | The user whose birthday is to be delete |\n\nreturns : [Birthday](https://github.com/AyrozDZN/discord-birthday/blob/master/src/index.ts)\n\n\n## getGuildBirthdays\n\n```js\nclient.birthday.getGuildBirthdays(guild).then((birthdays) => {\n    console.log(birthdays)\n    /*\n    [\n        {\n            member: <GuildMember>,\n            seeAge: <Boolean>,\n            date: <Date>,\n            age: <Number>,\n            nextBirthday: <Date>,\n            daysBeforeNext: <Number>,\n            guild: <Guild>\n        },\n        ...\n    ]\n    */\n}).catch((err) => console.error(err));\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| guild | [Guild](https://discord.js.org/#/docs/discord.js/main/class/Guild) | The guild in which the birthdays are to be collected |\n\nreturns : [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)\\[[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)\\]>\n\n## activateMemberBirthday\n\n```js\nclient.birthday.activateMemberBirthday(member) // return error if already activated or member has no birthday set\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| member | [GuildMember](https://discord.js.org/#/docs/discord.js/main/class/GuildMember) | The member whose birthday is to be activated |\n\nreturns : [Birthday](https://github.com/AyrozDZN/discord-birthday/blob/master/src/index.ts)\n\n## deactivateMemberBirthday\n\n```js\nclient.birthday.deactivateMemberBirthday(member) // return error if already deactivated or member has no birthday set\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| member | [GuildMember](https://discord.js.org/#/docs/discord.js/main/class/GuildMember) | The member whose birthday is to be deactivated |\n\nreturns : [Birthday](https://github.com/AyrozDZN/discord-birthday/blob/master/src/index.ts)\n\n## checkMemberGuildBirthdaysStatus\n\n```js\nconst status = client.birthday.checkMemberGuildBirthdaysStatus(member) // returns true or false\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| member | [GuildMember](https://discord.js.org/#/docs/discord.js/main/class/GuildMember) | The member whose birthday is checked |\n\nreturns : [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean)\n\n## setGuildBirthdayChannel\n\n```js\nclient.birthday.setGuildBirthdayChannel(channel)\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| channel | [TextChannel](https://discord.js.org/#/docs/discord.js/main/class/TextChannel) | The channel in which the birthdays will be wished |\n\nreturns : [Birthday](https://github.com/AyrozDZN/discord-birthday/blob/master/src/index.ts)\n\n## getGuildBirthdayChannel\n\n```js\nclient.birthday.getGuildBirthdayChannel(guild).then((channel) => {\n    console.log(channel) /* <NonThreadGuildBasedChannel> */\n}).catch((err) => console.error(err));\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| guild | [Guild](https://discord.js.org/#/docs/discord.js/main/class/Guild) | The guild in which the channel is to be collected |\n\nreturns : [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) <[GuildChannel](https://discord.js.org/#/docs/discord.js/main/class/GuildChannel)>\n\n## deleteGuildBirthdayChannel\n\n```js\nclient.birthday.deleteGuildBirthdayChannel(guild)\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| guild | [Guild](https://discord.js.org/#/docs/discord.js/main/class/Guild) | The guild in which the birthdays channel will be delete |\n\nreturns : [Birthday](https://github.com/AyrozDZN/discord-birthday/blob/master/src/index.ts)\n\n# Events\n\n## isBirthday\n\n```js\nclient.birthday.on(\"isBirthday\", (user, guilds) => {\n    console.log(`The birthday of ${user.tag} has been wished in ${guilds.length}`);\n    guilds.forEach(guild => {\n        guild.channels.get(\"...\").send({content: `It's the birthday of ${member.user.tag}`})\n    })\n});\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| user | [User](https://discord.js.org/#/docs/discord.js/main/class/User) | The user whose birthday has been wished |\n| guilds | [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) \\<[Guild](https://discord.js.org/#/docs/discord.js/main/class/Guild)> | Array of all guild where the birthday has been wished |\n\n## birthdayUserSet\n\n```js\nclient.birthday.on(\"birthdayUserSet\", (user, date) => {\n    console.log(`The birthday of ${user.tag} is ${date.toDateString()}`);\n});\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| user | [User](https://discord.js.org/#/docs/discord.js/main/class/User) | The user whose birthday has been set up |\n| date | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | The birthday date |\n\n## birthdayUserDelete\n\n```js\nclient.birthday.on(\"birthdayUserDelete\", (user) => {\n    console.log(`The birthday of ${user.tag} has been delete`);\n});\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| user | [User](https://discord.js.org/#/docs/discord.js/main/class/User) | The user whose birthday has been deleted |\n\n## birthdayMemberActivate\n\n```js\nclient.birthday.on(\"birthdayMemberActivate\", (member) => {\n    console.log(`The birthday of ${member.user.tag} has been activated in ${member.guild.name}`);\n});\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| member | [GuildMember](https://discord.js.org/#/docs/discord.js/main/class/GuildMember) | The member whose birthday has been activated |\n\n## birthdayMemberDeactivate\n\n```js\nclient.birthday.on(\"birthdayMemberDeactivate\", (member) => {\n    console.log(`The birthday of ${member.user.tag} has been deactivated in ${member.guild.name}`);\n});\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| member | [GuildMember](https://discord.js.org/#/docs/discord.js/main/class/GuildMember) | The member whose birthday has been deactivated |\n\n## birthdayGuildChannelSet\n\n```js\nclient.birthday.on(\"birthdayGuildChannelSet\", (channel) => {\n    console.log(`The birthday channel ${channel.name} has been set for the guild ${channel.guild.name}`);\n});\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| channel | [GuildChannel](https://discord.js.org/#/docs/discord.js/main/class/GuildChannel) | The channel whose birthday channel has been set up |\n\n## birthdayGuildChannelDelete\n\n```js\nclient.birthday.on(\"birthdayGuildChannelSet\", (guild) => {\n    console.log(`The birthday channel of ${guild.name} has been delete`);\n});\n```\n\n| Parameter | Type | Description |\n|--|--|--|\n| guild | [Guild](https://discord.js.org/#/docs/discord.js/main/class/Guild) | The Guild whose birthday channel has been delete |","readmeFilename":"README.md"}