8000 ✨Discord Channel Notification Settings Lens by sojinmm · Pull Request #236 · Spectral-Finance/lux · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

✨Discord Channel Notification Settings Lens #236

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sojinmm
Copy link
Contributor
@sojinmm sojinmm commented Apr 3, 2025

✨ Discord Channel Notification Settings Lens

Implemented a new lens for retrieving notification settings from Discord channels. This lens provides a clean interface to access channel-specific notification configurations, including mute status, notification levels, and custom overrides.

Key Features:

  • Simple Interface: Fetch settings with just the channel_id parameter
  • Comprehensive Settings: Access mute status, notification levels, and time-based configurations
  • Channel Overrides: View custom notification rules specific to the channel
  • Robust Error Handling: Direct propagation of Discord API errors for easier debugging
  • Channel ID Validation: Using regex pattern for parameter validation
  • Clean Response Structure: Transforms Discord API response into an intuitive format
  • Comprehensive Test Coverage: Validates both success and error scenarios

Technical Implementation:

  • Adheres to Lux.Lens behavior
  • Utilizes Discord API v10 endpoint
  • Pattern matching for response transformation
  • Maintains consistency with other Discord lenses

Example Usage:

GetChannelNotificationSettings.focus(%{channel_id: "123456789"})

Response Format:

{:ok, %{
  muted: false,
  message_notifications: 1,
  mute_config: %{
    end_time: nil,
    selected_time_window: nil
  },
  channel_overrides: %{
    muted: false,
    message_notifications: 0
  }
}}

Future Improvements:

  • Add support for bulk channel settings retrieval
  • Implement caching for frequently accessed settings
  • Add notification level validation
  • Support for updating notification settings
  • Add helper functions for common notification configurations

Related Documentation:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0