Skip to content

Commit

Permalink
Ratify bot-mode (#495)
Browse files Browse the repository at this point in the history
Co-authored-by: James Wheare <james@wheare.org>
  • Loading branch information
progval and jwheare authored Apr 26, 2022
1 parent fda4587 commit 446235c
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions extensions/bot-mode.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: Bot Mode
layout: spec
work-in-progress: true
meta-description: A user mode that indicates a user is a bot.
copyrights:
-
Expand All @@ -10,19 +9,11 @@ copyrights:
email: "daniel@danieloaks.net"
---

## Notes for implementing work-in-progress version

This is a work-in-progress specification.

Software implementing this work-in-progress specification MUST NOT use the
unprefixed `bot` tag name. Instead, implementations SHOULD use the
`draft/bot` tag name to be interoperable with other software
implementing a compatible work-in-progress version.

The final version of the specification will use an unprefixed tag name.

## Introduction
This is a standardised mode that lets clients mark themselves as bots, and lets other clients see them as bots.
This specification defines a standardised mechanism to allow clients to mark themselves as bots.

## Motivation
This functionality was previously implemented by several IRC servers in independent ways using fixed mode letters and conflicting WHOIS numerics. This specification seeks to standardise the functionality, adding a message tag for increased visibility of bot status and an ISUPPORT token to allow for more flexible implementations.

## The `BOT` ISUPPORT token
Servers publishing the `BOT` [ISUPPORT](https://modern.ircdocs.horse/#feature-advertisement) token let clients mark themselves as bots by setting a user mode. The value of the `BOT` token is the mode character which is used to enable bot mode and is also the flag used in `WHO` responses of bots (e.g. `BOT=B` or `BOT=b`).
Expand All @@ -40,8 +31,8 @@ Like other WHOIS reply numerics, `<nick>` is the nick of the sender, `<target>`
## The `WHO` bot flag
When a `RPL_WHOREPLY` `(352)` numeric is returned for a bot, the character used as the value of the ISUPPORT `BOT` token is returned in the flags (alongside `H|G`).

## The `draft/bot` tag
The `draft/bot` tag indicates that the given user is a bot. This tag SHOULD be added by the server to all commands sent by a bot (e.g. `PRIVMSG`, `JOIN`, `MODE`, `NOTICE`, and all others). The tag SHOULD also be added by the ircd to all numerics directly caused by the bot. This tag MUST only be sent to users who have requested the `message-tags` capability. Servers MUST NOT send this tag with a value, and clients MUST ignore any value if it exists.
## The `bot` tag
The `bot` tag indicates that the given user is a bot. This tag SHOULD be added by the server to all commands sent by a bot (e.g. `PRIVMSG`, `JOIN`, `MODE`, `NOTICE`, and all others). The tag SHOULD also be added by the ircd to all numerics directly caused by the bot. This tag MUST only be sent to users who have requested the `message-tags` capability. Servers MUST NOT send this tag with a value, and clients MUST ignore any value if it exists.

## Examples

Expand Down Expand Up @@ -78,10 +69,10 @@ Server: :irc.ircv3.net 352 alice #chat ~u 198.51.100.103 irc.ircv3.net alice H :
Server: :irc.ircv3.net 352 alice #chat ~u 203.0.113.22 irc.ircv3.net robodan Hb :0 Hi, I'm a bot!
Server: :irc.ircv3.net 315 alice #chat :End of WHO list
[ ... ]
Server: @draft/bot :robodan!~u@203.0.113.22 PRIVMSG #chat :Hello! Try typing .help to see my commands!
Server: @bot :robodan!~u@203.0.113.22 PRIVMSG #chat :Hello! Try typing .help to see my commands!
```

Example of some future value being sent, which the receiving client will ignore and process as a bare `@draft/bot` tag:
Example of some future value being sent, which the receiving client will ignore and process as a bare `@bot` tag:
```
Server: @draft/bot=someFutureValueHere=2343 :robodan!~u@203.0.113.22 PRIVMSG #chat :Hello! Try typing .help to see my commands!
Server: @bot=someFutureValueHere=2343 :robodan!~u@203.0.113.22 PRIVMSG #chat :Hello! Try typing .help to see my commands!
```

0 comments on commit 446235c

Please sign in to comment.