# Sending and managing messages

> Send, reply, edit, delete and react to messages, and read a channel's history.

## Send and reply

**JavaScript:**

```js
const general = community.channels.find((c) => c.name === "general");
const sent = await general.send("hello");
await sent.reply("replying to myself");
```

**Rust:**

```rust
let general = community.channel_by_name("general").expect("a general channel");
let sent = general.send("hello")?;
sent.reply("replying to myself")?;
```

## Edit, delete, react

**JavaScript:**

```js
const message = await general.send("typo");
await message.edit("fixed");
await message.react("👍");
await message.delete();
```

**Rust:**

```rust
let mut message = general.send("typo")?;
message.edit("fixed")?;
message.react("👍")?;
message.delete()?;
```

You can edit and delete your own messages; deleting someone else's needs `MANAGE_MESSAGES`.

## History

The client keeps no message history of its own; fetch pages from the host:

**JavaScript:**

```js
const latest = await general.messages.fetch({ limit: 50 });
```

**Rust:**

```rust
// Up to 50 messages before sequence number `before` (the newest without it), oldest first.
let latest = general.messages(None, 50)?;
```

## Partial messages

An edit or deletion event only says what changed, so it carries a **partial** message: its id, and
for an edit its new text. It still acts (`reply`, `edit`, `delete`, `react`), but fields the event
didn't include are empty.
