IRC-Documentation/doc/prefixing.md
2024-12-28 13:18:12 -08:00

32 lines
No EOL
921 B
Markdown

[⬅️ Back to `index`](index.md)
# Colon prefixing
In some commands (like PRIVMSG, TOPIC, USER, NOTICE, etc), the client needs to add a colon before the content (NOT after the command)
❌ Your client shouldn't do this:
```
↗️ PRIVMSG foo this is a very cool message
🔀 nick!ident@host PRIVMSG foo :this
```
The server will only detect the first word
❌ Your client shouldn't do this either:
```
↗️ PRIVMSG foo: this is a very cool message
↙️ :server 401 nick foo: :No such nick/channel
```
The server will think that the target (or whatever is before the content) ends with a colon.
For more info on error 401, see [No such nick/channel](nosuchnick.md)
✅ Here's what it should do:
```
↗️ PRIVMSG foo :this is a very cool message
🔀 nick!ident@host PRIVMSG foo :this is a very cool message
```
Your client should be able to parse the colon out.
```
<nick> this is a very cool message
```