diff --git a/BirthdayBot.csproj b/BirthdayBot.csproj index 8b6d6bc..282cb13 100644 --- a/BirthdayBot.csproj +++ b/BirthdayBot.csproj @@ -36,4 +36,8 @@ + + Docs/**;$(DefaultItemExcludes) + + diff --git a/Docs/.gitignore b/Docs/.gitignore new file mode 100644 index 0000000..f07bd2e --- /dev/null +++ b/Docs/.gitignore @@ -0,0 +1,9 @@ +_site +.sass-cache +.jekyll-cache +.jekyll-metadata +vendor + +# Sourced externally; cautiously excluding from repo +# Get it from https://www.flaticon.com/free-icon/birthday-cake_168532 +birthday-cake.png \ No newline at end of file diff --git a/Docs/Gemfile b/Docs/Gemfile new file mode 100644 index 0000000..35d6a52 --- /dev/null +++ b/Docs/Gemfile @@ -0,0 +1,4 @@ +source "https://rubygems.org" +gem "jekyll", "~> 4.3.2" +gem "jekyll-remote-theme" +gem "jekyll-seo-tag" diff --git a/Docs/Gemfile.lock b/Docs/Gemfile.lock new file mode 100644 index 0000000..43cb228 --- /dev/null +++ b/Docs/Gemfile.lock @@ -0,0 +1,82 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + colorator (1.1.0) + concurrent-ruby (1.1.10) + em-websocket (0.5.3) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0) + eventmachine (1.2.7) + ffi (1.15.5) + forwardable-extended (2.6.0) + google-protobuf (3.21.12-x86_64-linux) + http_parser.rb (0.8.0) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + jekyll (4.3.2) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (>= 0.3.6, < 0.5) + pathutil (~> 0.9) + rouge (>= 3.0, < 5.0) + safe_yaml (~> 1.0) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-remote-theme (0.4.3) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0) + rubyzip (>= 1.3.0, < 3.0) + jekyll-sass-converter (3.0.0) + sass-embedded (~> 1.54) + jekyll-seo-tag (2.8.0) + jekyll (>= 3.8, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (2.4.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.8.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.4.0) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (5.0.1) + rake (13.0.6) + rb-fsevent (0.11.2) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.5) + rouge (4.0.1) + rubyzip (2.3.2) + safe_yaml (1.0.5) + sass-embedded (1.57.1) + google-protobuf (~> 3.21) + rake (>= 10.0.0) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + unicode-display_width (2.4.2) + webrick (1.7.0) + +PLATFORMS + x86_64-linux + +DEPENDENCIES + jekyll (~> 4.3.2) + jekyll-remote-theme + jekyll-seo-tag + +BUNDLED WITH + 2.4.5 diff --git a/Docs/_config.yml b/Docs/_config.yml new file mode 100644 index 0000000..10bd6e1 --- /dev/null +++ b/Docs/_config.yml @@ -0,0 +1,25 @@ +# https://github.com/BDHU/minimalist +title: Birthday Bot +description: An automated way to recognize birthdays in your community! +logo: /birthday-cake.png +show_downloads: false +remote_theme: BDHU/minimalist +color-scheme: dark + +plugins: + - jekyll-remote-theme + +# https://icon-sets.iconify.design/ +sidebar: + - name: Invite the bot + icon: + link: https://discord.com/api/oauth2/authorize?client_id=470673087671566366&permissions=268451840&scope=bot%20applications.commands + - name: Official server + icon: + link: https://discord.gg/JCRyFk7 + - name: GitHub + icon: + link: https://github.com/NoiTheCat/BirthdayBot + - name: Support me on Ko-fi + icon: + link: https://ko-fi.com/noithecat \ No newline at end of file diff --git a/Docs/index.md b/Docs/index.md new file mode 100644 index 0000000..97f6fb3 --- /dev/null +++ b/Docs/index.md @@ -0,0 +1,38 @@ +--- +layout: default +title: Documentation +--- +# Birthday Bot + +**An automated way to recognize birthdays in your community!** + +Birthday Bot is a utility for your community which enables your users to share their birthdays, check birthdays of others, and mark and announce birthdays as they happen. Server moderators can additionally set up a default time zone with users having the option to set their own, ensuring all birthdays are recognized precisely on time. + +### Getting started +Invite the bot via the link on the sidebar. Please note that several permissions are requested during the invite process which are required for the bot to function properly. + +Once added, a small amount of initial set-up before it's ready for use: +* Create a dedicated birthday role to be used only by the bot. Ensure the new role is placed beneath the bot's own role. +* Instruct the bot to use the role: `/config role set-birthday-role` +>

Do not use an existing role! This bot will take full and exclusive control over it. Users that have the role but are not having a birthday + *will* be removed from it!

+ +Optional, but recommended: +* Customize the announcement message: See `/config announce help` for more information. +* Set the birthday announcement channel: `/config announce set-channel` +* Set a default time zone: `/config set-timezone` + +### Supporting the bot +Birthday Bot is provided for free, period. No paywalled features, subscriptions, or monetization insentices. This is an independent hobby project done in my spare time, and all costs associated with it come out of my pocket. My only interest is to provide something that I hope others find as useful as I do. + +That said, this bot has proven to be far more popular than I ever anticipated, and keeping things running has occasionally strained me both financially and time-wise. If you'd like, please consider pitching in a bit to cover my recurring costs by checking out my Ko-fi page on the sidebar. + +### Privacy and Security +This bot collects and stores only information necessary for its operation, then associated to user, server, and role IDs. As little information is stored as possible and access to the database is strongly restricted through proper security practices. + +Birthday information is not shared between servers *by design*, for those preferring to be selective about where they want their information known. Users must set their birthday settings in each individual server. + +Any questions and concerns regarding data privacy, security, and retention may be sent to the bot author via the support server or by opening an issue on GitHub. + +### Image credit +Cake icons created by Freepik - Flaticon \ No newline at end of file diff --git a/Readme.md b/Readme.md index 26b0cb1..423731f 100644 --- a/Readme.md +++ b/Readme.md @@ -1,52 +1,37 @@ # Birthday Bot +An automated way to recognize birthdays in your community! -* Info: https://discord.bots.gg/bots/470673087671566366 +[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/J3J65TW2E) -## Recognize birthdays in your Discord community! +#### Documentation, help, resources +* [Main website, user documentation](https://noithecat.dev/bots/BirthdayBot) +* [Official server](https://discord.gg/JCRyFk7) -Birthday Bot is a simple, single-purpose bot. It will set a role on your users for the duration of their birthdays and, if desired, can -announce a message in a channel of your choosing. Server owners can further specify a default time zone, with individual users also setting -their own to ensure everyone's birthdays are recognized precisely on time. +#### Running your own instance +You need: +* .NET 6 (https://dotnet.microsoft.com/en-us/) +* PostgreSQL (https://www.postgresql.org/) +* EF Core tools (https://learn.microsoft.com/en-us/ef/core/get-started/overview/install#get-the-entity-framework-core-tools) +* A Discord bot token (https://discord.com/developers/applications) -#### Getting started -This bot requires a small amount of initial set-up before it's ready for use. To quickly get started, ensure that you: -* Create a dedicated birthday role to be used only by the bot. Ensure the new role is placed beneath the bot's own role. - * **Do not use an existing role!** This bot assumes exclusive control over it. Users that have the role but are not having a birthday - *will* be removed from it! -* Instruct the bot to use the role: `/config role set-birthday-role` -At this point, you may also wish to do the following optional steps: -* Set the birthday announcement channel: `/config announce set-channel` -* Set a default time zone: `/config set-timezone` -* Customize the announcement message: See `/config announce help` for more information. +Get your bot token and set up your database user and schema, then create a JSON file containing the following: +```jsonc +{ + "BotToken": "your bot token here", + "SqlHost": "localhost", // optional + "SqlDatabase": "birthdaybot", // optional + "SqlUser": "birthdaybot", // required + "SqlPassword": "birthdaybot" // required; no other authentication methods are currently supported +} +``` -#### Time zone support -You may specify a time zone in order to have your birthday recognized with respect to your local time. This bot only accepts zone names -from the IANA Time Zone Database (a.k.a. Olson Database). -* To find your zone: https://xske.github.io/tz/ -* Interactive map: https://kevinnovak.github.io/Time-Zone-Picker/ -* Complete list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones +Then run the following commands: +```sh +$ dotnet restore +$ dotnet ef database update -- -c path/to/config.json +``` -#### Support the bot -Birthday Bot is and shall remain fully free to use. I have no plans to hide any new or existing features behind pay-only, premium features. -This is an independent hobby project and all costs associated with it come out of my pocket. - -This bot has had a far greater response than I've ever expected, and at this point I find it difficult to pay for the server it runs on as -its resource needs grow. I would greatly appreciate if you consider pitching in a little bit to cover my recurring costs by checking out my -Ko-fi page: https://ko-fi.com/noithecat. - -#### Support, Privacy and Security -The support server for my bots can be accessed via the given link: https://discord.gg/JCRyFk7. Further information in setting up the bot -can be found within it, as well as a small group of volunteers who are willing to answer questions. - -This bot collects and stores only information necessary for its operation, including user, server, and role IDs. This data is not stored -indefinitely, but is removed after an extended period of lack of use. If an individual member of a server is not seen after 360 days, their -data is purged. If the bot has been removed from a server, all data (including of its associated users) is purged after 180 days. - -Birthdays are not shared between servers that this same bot may be in. This is *by design*, for those preferring to share their birthdays -with only certain communities instead of automatically sharing it to all of them. Users must enter their birthday information onto every -server they share with the bot for the servers they wish for it to be known in. - -Any questions and concerns regarding data and security may be sent to the bot author via the support server or GitHub. - -#### Image credit -The icon used by this bot is from Flaticon, found at: https://www.flaticon.com/free-icon/birthday-cake_168532 \ No newline at end of file +And finally, to run the bot: +``` +$ dotnet run -c Release -- -c path/to/config.json +``` \ No newline at end of file