reddit_channel
reddit_channel
¶
RedditChannel — Reddit adapter via praw.
Classes¶
RedditChannel
¶
RedditChannel(
client_id: str = "",
*,
client_secret: str = "",
username: str = "",
password: str = "",
user_agent: str = "",
bus: Optional[EventBus] = None,
)
Bases: BaseChannel
Reddit messaging channel adapter.
Uses the Reddit API via praw (Python Reddit API Wrapper).
| PARAMETER | DESCRIPTION |
|---|---|
client_id
|
Reddit app client ID. Falls back to
TYPE:
|
client_secret
|
Reddit app client secret. Falls back to
TYPE:
|
username
|
Reddit username. Falls back to
TYPE:
|
password
|
Reddit password. Falls back to
TYPE:
|
user_agent
|
User-agent string for API requests. Falls back to
TYPE:
|
bus
|
Optional event bus for publishing channel events.
TYPE:
|
Source code in src/diapason/channels/reddit_channel.py
Methods:¶
connect
¶
Validate credentials and mark as connected.
Source code in src/diapason/channels/reddit_channel.py
disconnect
¶
send
¶
send(
channel: str,
content: str,
*,
conversation_id: str = "",
metadata: Dict[str, Any] | None = None,
) -> bool
Send a message or comment on Reddit.
| PARAMETER | DESCRIPTION |
|---|---|
channel
|
Subreddit name (without
TYPE:
|
content
|
Text content for the submission or comment.
TYPE:
|
Source code in src/diapason/channels/reddit_channel.py
status
¶
status() -> ChannelStatus