DiscordReader#
- pydantic model llama_index.readers.DiscordReader#
Discord reader.
Reads conversations from channels.
- Parameters
discord_token (Optional[str]) – Discord token. If not provided, we assume the environment variable DISCORD_TOKEN is set.
Show JSON schema
{ "title": "DiscordReader", "description": "Discord reader.\n\nReads conversations from channels.\n\nArgs:\n discord_token (Optional[str]): Discord token. If not provided, we\n assume the environment variable `DISCORD_TOKEN` is set.", "type": "object", "properties": { "is_remote": { "title": "Is Remote", "default": true, "type": "boolean" }, "discord_token": { "title": "Discord Token", "type": "string" }, "class_name": { "title": "Class Name", "type": "string", "default": "DiscordReader" } }, "required": [ "discord_token" ] }
- Config
arbitrary_types_allowed: bool = True
- Fields
discord_token (str)
is_remote (bool)
- field discord_token: str [Required]#
- field is_remote: bool = True#
- classmethod class_name() str #
Get the class name, used as a unique ID in serialization.
This provides a key that makes serialization robust against actual class name changes.
- load_data(channel_ids: List[int], limit: Optional[int] = None, oldest_first: bool = True) List[Document] #
Load data from the input directory.
- Parameters
channel_ids (List[int]) – List of channel ids to read.
limit (Optional[int]) – Maximum number of messages to read.
oldest_first (bool) – Whether to read oldest messages first. Defaults to True.
- Returns
List of documents.
- Return type
List[Document]