# DiscordRetrieveTool

## `autogen.tools.experimental.DiscordRetrieveTool`

```
DiscordRetrieveTool(*, bot_token, channel_name, guild_name)
```

Bases: `Tool`

Retrieves messages from a Discord channel.

### Parameters
| PARAMETER        | DESCRIPTION                                                                                   |
|------------------|-----------------------------------------------------------------------------------------------|
| `bot_token`      | The bot token to use for retrieving messages.<br>**TYPE:** `str`                             |
| `channel_name`   | The name of the channel to retrieve messages from.<br>**TYPE:** `str`                         |
| `guild_name`     | The name of the guild for the channel.<br>**TYPE:** `str`                                   |

Source code in `autogen/tools/experimental/messageplatform/discord/discord.py`

```python
class DiscordRetrieveTool(Tool):
    def __init__(self, *, bot_token: str, channel_name: str, guild_name: str) -> None:
        """Initialize the DiscordRetrieveTool.
        Args:
            bot_token: The bot token to use for retrieving messages.
            channel_name: The name of the channel to retrieve messages from.
            guild_name: The name of the guild for the channel.
        """
        async def discord_retrieve_messages(...)
            # Implementation code
        super().__init__(name="discord_retrieve", description="Retrieves messages from a Discord channel based datetime/message ID and/or number of latest messages.", func_or_tool=discord_retrieve_messages)
```

### `register_for_llm`
```
register_for_llm(agent)
```

Registers the tool for use with a ConversableAgent's language model (LLM).

| PARAMETER | DESCRIPTION                                                   |
|-----------|---------------------------------------------------------------|
| `agent`   | The agent to which the tool will be registered.<br>**TYPE:** `ConversableAgent` |

Source code in `autogen/tools/tool.py`

```python
def register_for_llm(self, agent: "ConversableAgent") -> None:
    """Registers the tool for use with a ConversableAgent's language model (LLM).
    Args:
        agent (ConversableAgent): The agent to which the tool will be registered.
    """
    # Implementation code
```

### `register_for_execution`
```
register_for_execution(agent)
```

Registers the tool for direct execution by a ConversableAgent.

Source code in `autogen/tools/tool.py`

```python
def register_for_execution(self, agent: "ConversableAgent") -> None:
    """Registers the tool for direct execution by a ConversableAgent.
    Args:
        agent (ConversableAgent): The agent to which the tool will be registered.
    """
    # Implementation code
```

### `register_tool`
```
register_tool(agent)
```

Register a tool to be both proposed and executed by an agent.

Source code in `autogen/tools/tool.py`

```python
def register_tool(self, agent: "ConversableAgent") -> None:
    """Register a tool to be both proposed and executed by an agent.
    Args:
        agent (ConversableAgent): The agent to which the tool will be registered.
    """
    # Implementation code
```
