-
-
Notifications
You must be signed in to change notification settings - Fork 37
feat: @robojs/events-manager plugin for event management #455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DevArqf
wants to merge
27
commits into
Wave-Play:main
Choose a base branch
from
DevArqf:feature/add-discord-events-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
c08046a
feat: add discord-events plugin for comprehensive event management
DevArqf 2bc7a41
refactor: rename plugin to events-manager
DevArqf c255945
\chore: remove unnecessary CHANGELOG.md and DEVELOPMENT.md files\
DevArqf 083c54c
feat(plugin-events-manager): implement Flashcore persistence and fix โฆ
DevArqf 39f0c95
fix(plugin-events-manager): use valid ManageGuild permission instead โฆ
DevArqf 1855b49
refactor(plugin-events-manager): remove custom NLP date parsing
DevArqf f2e51e0
refactor(plugin-events-manager): use crypto-based ID generation
DevArqf 9fb6dfb
refactor(plugin-events-manager): consolidate duplicate embed and buttโฆ
DevArqf ad60179
feat(plugin-events-manager): implement functional reminder processing
DevArqf 7b20fe0
fix(plugin-events-manager): add null check for regex match in button โฆ
DevArqf 29b7258
fix(plugin-events-manager): remove non-functional pagination buttons
DevArqf 8d54c70
refactor(plugin-events-manager): check event capacity before RSVP update
DevArqf dc4172d
refactor(plugin-events-manager): remove personal branding from plugin
DevArqf bbf83e3
refactor(plugin-events-manager): remove unused saveEvent import
DevArqf 0527c21
fix(plugin-events-manager): store dates as timestamps for JSON serialโฆ
DevArqf f9cc173
fix(plugin-events-manager): handle null/undefined location in remindeโฆ
DevArqf a3ed6a6
fix: enhance date validation to properly catch invalid dates like Feb 31
DevArqf 2a7eadc
fix: remove incorrect length check on ActionRowBuilder in event-list
DevArqf 640e371
fix: ensure currentAttendees is always initialized when loading events
DevArqf e6f7ef2
fix: handle deserialized event dates defensively in event-remind
DevArqf 0ea8e87
fix: add defensive handling for reminderTime in confirmation embed
DevArqf 516de6c
fix: normalize dateTime in getEvent to prevent runtime errors
DevArqf 43b8785
fix: handle reminder backlog up to 7 days and validate dates
DevArqf b3850a2
fix: add defensive date handling and description truncation in remindโฆ
DevArqf 86ac528
fix: prevent overlapping reminder runs and duplicate intervals on hotโฆ
DevArqf 015462f
fix: strengthen customId parsing in view attendees button handler
DevArqf 026f02c
fix: remove non-functional refresh button from event list
DevArqf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| node_modules/ | ||
| dist/ | ||
| .robo/build/ | ||
| *.log | ||
| .env* | ||
| .DS_Store | ||
| coverage/ | ||
| .nyc_output/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2025 Discord Events Manager Plugin Contributors | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,213 @@ | ||
| <p align="center">โจ <strong>Generated with <a href="https://robojs.dev/create-robo">create-robo</a> magic!</strong> โจ</p> | ||
|
|
||
| --- | ||
|
|
||
| # ๐ Discord Events Manager | ||
|
|
||
| **A comprehensive Discord events management plugin for Robo.js** that helps communities organize events with RSVP tracking, automated reminders, and seamless Discord integration. | ||
|
|
||
|  | ||
|  | ||
|  | ||
|
|
||
| ## โจ Features | ||
|
|
||
| - **๐ฏ Event Creation**: Create detailed events with dates, descriptions, locations, and attendance limits | ||
| - **๐ RSVP System**: Track who's going, maybe attending, or can't attend (persisted in Flashcore) | ||
| - **โฐ Smart Reminders**: Automated event reminders (1 hour to 1 week before, stored in Flashcore) | ||
| - **๐ Attendee Management**: View and manage event participants | ||
| - **๐ Event Discovery**: List and filter events by date, creator, or status | ||
| - **๐ฅ Interactive UI**: Easy event creation through Discord modals | ||
| - **๐จ Rich Embeds**: Beautiful Discord embeds with interactive buttons | ||
| - **๐ Permissions**: Role-based event management with proper permissions | ||
|
|
||
| ## ๐ฆ Installation | ||
|
|
||
| To add this plugin to your **Robo.js** project: | ||
|
|
||
| ```bash | ||
| npx robo add events-manager | ||
| ``` | ||
|
|
||
| New to **Robo.js**? Start your project with this plugin pre-installed: | ||
|
|
||
| ```bash | ||
| npx create-robo <project-name> -p events-manager | ||
| ``` | ||
|
|
||
| ## ๐ฎ Commands | ||
|
|
||
| ### `/event-create` - Create New Events | ||
|
|
||
| Create detailed events with full customization: | ||
|
|
||
| ```bash | ||
| /event-create | ||
| ``` | ||
|
|
||
| This opens a modal where you can specify: | ||
| - Event title | ||
| - Description | ||
| - Date & Time (format: `YYYY-MM-DD HH:MM`) | ||
| - Location (optional) | ||
| - Max attendees (optional) | ||
|
|
||
| ### `/event-list` - Browse Events | ||
|
|
||
| View and filter community events: | ||
|
|
||
| ```bash | ||
| /event-list # Show upcoming events | ||
| /event-list filter:past # Show past events | ||
| /event-list filter:all # Show all events | ||
| /event-list user:@SomeUser # Show events by specific user | ||
| ``` | ||
|
|
||
| ### `/event-remind` - Set Reminders | ||
|
|
||
| Schedule automatic event reminders: | ||
|
|
||
| ```bash | ||
| /event-remind event:"Gaming Night" time:"1 day before" channel:#events | ||
| ``` | ||
|
|
||
| **Reminder Options:** | ||
| - 1 hour before | ||
| - 6 hours before | ||
| - 1 day before | ||
| - 3 days before | ||
| - 1 week before | ||
|
|
||
| ## ๐ฏ Usage Examples | ||
|
|
||
| ### Creating a Gaming Event | ||
|
|
||
| ```bash | ||
| /event-create | ||
| ``` | ||
|
|
||
| Then fill in the modal with: | ||
| - **Title**: "Weekly Gaming Session" | ||
| - **Description**: "Join us for multiplayer fun!" | ||
| - **Date & Time**: "2025-12-01 20:00" | ||
| - **Location**: "Gaming Voice Channel" | ||
| - **Max Attendees**: "12" | ||
|
|
||
| ### Setting Up a Community Meeting | ||
|
|
||
| 1. Use `/event-create` (without quick-event parameter) | ||
| 2. Fill in the modal: | ||
| - **Title**: "Monthly Community Meeting" | ||
| - **Description**: "Discuss server updates, new features, and community feedback" | ||
| - **Date & Time**: "2025-10-20 19:00" | ||
| - **Location**: "General Voice Channel" | ||
| - **Max Attendees**: "50" | ||
|
|
||
| ### Managing RSVPs | ||
|
|
||
| Users can interact with event posts using buttons: | ||
| - **โ Going** - Confirm attendance (automatically tracked in Flashcore) | ||
| - **โ Maybe** - Tentative attendance (with capacity overflow protection) | ||
| - **โ Can't Go** - Decline attendance | ||
| - **๐ฅ View Attendees** - See actual user names and attendance counts | ||
|
|
||
| ### Setting Reminders | ||
|
|
||
| ```bash | ||
| /event-remind event:"Community Meeting" time:"1 day before" channel:#announcements | ||
| ``` | ||
|
|
||
| **Note:** Reminders are scheduled and stored in Flashcore, persisting across bot restarts. | ||
|
|
||
| ## ๐ง Configuration | ||
|
|
||
| ### Required Permissions | ||
|
|
||
| **For Event Creators:** | ||
| - `Manage Guild` permission OR `Administrator` | ||
|
|
||
| **For All Users:** | ||
| - `Use Application Commands` | ||
| - `Read Message History` | ||
| - `Send Messages` | ||
|
|
||
| ### Channel Setup | ||
|
|
||
| Recommended channel setup: | ||
| - **#events** - For event announcements | ||
| - **#event-reminders** - For automated reminders | ||
| - Voice channels for event locations | ||
|
|
||
| ## ๐จ Customization | ||
|
|
||
| ### Event Embed Colors | ||
| - **Upcoming Events**: Blue (`#5865F2`) | ||
| - **Past Events**: Gray (`#99AAB5`) | ||
| - **Reminders**: Orange (`#FFAA00`) | ||
| - **Confirmations**: Green (`#00FF00`) | ||
|
|
||
| ### Date/Time Format | ||
|
|
||
| Events use ISO 8601 date format: | ||
| - Format: `YYYY-MM-DD HH:MM` | ||
| - Example: `2025-12-25 14:30` | ||
| - Uses 24-hour time format | ||
|
|
||
| ## ๐พ Data Storage | ||
|
|
||
| This plugin uses **Flashcore**, Robo.js's built-in key-value storage system, to persist: | ||
| - Event details (title, description, date/time, location, attendees) | ||
| - RSVP responses (going, maybe, not going) | ||
| - Event reminders with scheduling information | ||
|
|
||
| All data is automatically saved and persists across bot restarts. No additional database setup required! | ||
|
|
||
| ## ๐ ๏ธ Development | ||
|
|
||
| To contribute to this plugin: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/Wave-Play/robo.js | ||
| cd robo.js/packages/plugin-events-manager | ||
| pnpm install | ||
| pnpm dev | ||
| ``` | ||
|
|
||
| ## ๐ค Contributing | ||
|
|
||
| Contributions are welcome! This plugin was created for **Hacktoberfest 2025**. Please: | ||
|
|
||
| 1. Fork the repository | ||
| 2. Create a feature branch | ||
| 3. Make your changes | ||
| 4. Add tests if applicable | ||
| 5. Submit a pull request | ||
|
|
||
| ## ๐ Roadmap | ||
|
|
||
| - [x] **Database Integration** - Persistent event storage using Flashcore | ||
| - [x] **RSVP Tracking** - Full Yes/Maybe/No response tracking with user data | ||
| - [x] **Event Reminders** - Scheduled reminders with Flashcore persistence | ||
| - [x] **Event Listing** - Filter events by date, creator, or status | ||
| - [ ] **Recurring Events** - Weekly/monthly event templates | ||
| - [ ] **Event Categories** - Gaming, Social, Educational, etc. | ||
| - [ ] **Calendar Integration** - Export to Google Calendar/Outlook | ||
| - [ ] **Event Analytics** - Attendance statistics and insights | ||
| - [ ] **Custom RSVP Options** - More than just Yes/No/Maybe | ||
| - [ ] **Event Templates** - Quick event creation from templates | ||
| - [ ] **Advanced Time Zone Support** - Automatic time zone conversion | ||
| - [ ] **Advanced Natural Language Processing** - Enhanced date parsing | ||
|
|
||
| ## ๐ Support | ||
|
|
||
| - **Documentation**: [Robo.js Documentation](https://robojs.dev) | ||
| - **Discord**: [Robo.js Community](https://robojs.dev/discord) | ||
| - **Issues**: Create an issue in this repository | ||
|
|
||
| ## ๐ License | ||
|
|
||
| MIT License - see [LICENSE](LICENSE) for details. | ||
|
|
||
| --- | ||
|
|
||
| **Made with โค๏ธ by DevArqf for the Discord community and Hacktoberfest 2025** | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // @ts-check | ||
|
|
||
| /** | ||
| * @type {import('robo.js').Config} | ||
| **/ | ||
| export default { | ||
| clientOptions: { | ||
| intents: ['Guilds', 'GuildMessages'] | ||
| }, | ||
| plugins: [], | ||
| type: 'plugin' | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| { | ||
| "name": "@robojs/events-manager", | ||
| "description": "A comprehensive Discord events management plugin for Robo.js that helps communities organize events with RSVP tracking, automated reminders, and seamless Discord integration.", | ||
| "version": "0.0.0", | ||
| "private": false, | ||
| "type": "module", | ||
| "main": ".robo/build/index.js", | ||
| "license": "MIT", | ||
| "author": "DevArqf", | ||
| "contributors": [ | ||
| "DevArqf" | ||
| ], | ||
| "files": [ | ||
| ".robo/", | ||
| "src/", | ||
| "config/", | ||
| "LICENSE", | ||
| "README.md" | ||
| ], | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "https://github.com/Wave-Play/robo.git", | ||
| "directory": "packages/plugin-events-manager" | ||
| }, | ||
| "publishConfig": { | ||
| "access": "public", | ||
| "registry": "https://registry.npmjs.org/" | ||
| }, | ||
| "scripts": { | ||
| "build": "robo build plugin", | ||
| "dev": "NODE_OPTIONS=--enable-source-maps robo build plugin --watch", | ||
| "lint": "pnpm lint:eslint && pnpm lint:style", | ||
| "lint:eslint": "eslint . --ext js,jsx,ts,tsx", | ||
| "lint:style": "prettier --write ." | ||
| }, | ||
| "devDependencies": { | ||
| "@swc/core": "^1.11.29", | ||
| "@types/node": "^20.16.5", | ||
| "@typescript-eslint/eslint-plugin": "^5.56.0", | ||
| "@typescript-eslint/parser": "^5.56.0", | ||
| "discord.js": "^14.7.1", | ||
| "eslint": "^8.36.0", | ||
| "prettier": "^2.8.5", | ||
| "robo.js": "workspace:*", | ||
| "typescript": "^5.0.0" | ||
| }, | ||
| "keywords": [ | ||
| "discord", | ||
| "events", | ||
| "rsvp", | ||
| "bot", | ||
| "robo", | ||
| "plugin", | ||
| "community", | ||
| "management" | ||
| ] | ||
| } |
73 changes: 73 additions & 0 deletions
73
packages/plugin-events-manager/src/commands/event-create.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| import { createCommandConfig, logger } from 'robo.js' | ||
| import { ModalBuilder, TextInputBuilder, TextInputStyle, ActionRowBuilder } from 'discord.js' | ||
|
|
||
| export const config = createCommandConfig({ | ||
| description: 'Create a new community event' | ||
| }) | ||
|
|
||
| export default async (interaction) => { | ||
| logger.info(`Event create command used by ${interaction.user.tag}`) | ||
|
|
||
| if (!interaction.member.permissions.has('ManageGuild') && !interaction.member.permissions.has('Administrator')) { | ||
| return interaction.reply({ | ||
| content: 'โ You need the "Manage Guild" permission to create events.', | ||
| ephemeral: true | ||
| }) | ||
| } | ||
|
|
||
| const modal = createEventModal() | ||
| await interaction.showModal(modal) | ||
| } | ||
|
|
||
|
|
||
| function createEventModal() { | ||
| const modal = new ModalBuilder() | ||
| .setCustomId('event-create-modal') | ||
| .setTitle('Create New Event') | ||
|
|
||
| const titleInput = new TextInputBuilder() | ||
| .setCustomId('event-title') | ||
| .setLabel('Event Title') | ||
| .setStyle(TextInputStyle.Short) | ||
| .setRequired(true) | ||
| .setMaxLength(100) | ||
|
|
||
| const descriptionInput = new TextInputBuilder() | ||
| .setCustomId('event-description') | ||
| .setLabel('Event Description') | ||
| .setStyle(TextInputStyle.Paragraph) | ||
| .setRequired(true) | ||
| .setMaxLength(1000) | ||
|
|
||
| const dateTimeInput = new TextInputBuilder() | ||
| .setCustomId('event-datetime') | ||
| .setLabel('Date & Time (format: YYYY-MM-DD HH:MM)') | ||
| .setStyle(TextInputStyle.Short) | ||
| .setRequired(true) | ||
|
|
||
| const locationInput = new TextInputBuilder() | ||
| .setCustomId('event-location') | ||
| .setLabel('Location (optional)') | ||
| .setStyle(TextInputStyle.Short) | ||
| .setRequired(false) | ||
| .setMaxLength(100) | ||
| .setPlaceholder('Discord Voice Channel, Online, etc.') | ||
|
|
||
| const maxAttendeesInput = new TextInputBuilder() | ||
| .setCustomId('event-max-attendees') | ||
| .setLabel('Max Attendees (optional)') | ||
| .setStyle(TextInputStyle.Short) | ||
| .setRequired(false) | ||
| .setPlaceholder('Leave empty for unlimited') | ||
|
|
||
| const rows = [ | ||
| new ActionRowBuilder().addComponents(titleInput), | ||
| new ActionRowBuilder().addComponents(descriptionInput), | ||
| new ActionRowBuilder().addComponents(dateTimeInput), | ||
| new ActionRowBuilder().addComponents(locationInput), | ||
| new ActionRowBuilder().addComponents(maxAttendeesInput) | ||
| ] | ||
|
|
||
| modal.addComponents(...rows) | ||
| return modal | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.