<!-- Code generated by gomarkdoc. DO NOT EDIT -->

# message

```go
import "github.com/lukaszraczylo/go-telegram/dispatch/filters/message"
```

Package message provides Filter helpers for \*api.Message payloads.

## Index

- [func AnyCommand\(\) dispatch.Filter\[\*api.Message\]](<#AnyCommand>)
- [func ChatType\(t api.ChatType\) dispatch.Filter\[\*api.Message\]](<#ChatType>)
- [func Command\(name string\) dispatch.Filter\[\*api.Message\]](<#Command>)
- [func FromUser\(userID int64\) dispatch.Filter\[\*api.Message\]](<#FromUser>)
- [func HasDocument\(\) dispatch.Filter\[\*api.Message\]](<#HasDocument>)
- [func HasEntity\(t api.MessageEntityType\) dispatch.Filter\[\*api.Message\]](<#HasEntity>)
- [func HasPhoto\(\) dispatch.Filter\[\*api.Message\]](<#HasPhoto>)
- [func InChat\(chatID int64\) dispatch.Filter\[\*api.Message\]](<#InChat>)
- [func IsForward\(\) dispatch.Filter\[\*api.Message\]](<#IsForward>)
- [func IsReply\(\) dispatch.Filter\[\*api.Message\]](<#IsReply>)
- [func Text\(pattern string\) dispatch.Filter\[\*api.Message\]](<#Text>)
- [func TextContains\(sub string\) dispatch.Filter\[\*api.Message\]](<#TextContains>)
- [func TextEquals\(s string\) dispatch.Filter\[\*api.Message\]](<#TextEquals>)
- [func TextPrefix\(prefix string\) dispatch.Filter\[\*api.Message\]](<#TextPrefix>)


<a name="AnyCommand"></a>
## func [AnyCommand](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L69>)

```go
func AnyCommand() dispatch.Filter[*api.Message]
```

AnyCommand returns a Filter that matches any message starting with a bot\_command entity at offset 0.

<a name="ChatType"></a>
## func [ChatType](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L124>)

```go
func ChatType(t api.ChatType) dispatch.Filter[*api.Message]
```

ChatType returns a Filter that matches messages whose Chat.Type equals t.

<a name="Command"></a>
## func [Command](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L44>)

```go
func Command(name string) dispatch.Filter[*api.Message]
```

Command returns a Filter that matches messages whose first entity is a bot\_command equal to "/\<name\>" \(with or without "@BotName" suffix\).

<a name="FromUser"></a>
## func [FromUser](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L131>)

```go
func FromUser(userID int64) dispatch.Filter[*api.Message]
```

FromUser returns a Filter that matches messages whose From.ID equals userID.

<a name="HasDocument"></a>
## func [HasDocument](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L101>)

```go
func HasDocument() dispatch.Filter[*api.Message]
```

HasDocument returns a Filter that matches messages with a Document attachment.

<a name="HasEntity"></a>
## func [HasEntity](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L109>)

```go
func HasEntity(t api.MessageEntityType) dispatch.Filter[*api.Message]
```

HasEntity returns a Filter that matches messages whose Entities contain at least one entity of type t \(e.g. api.MessageEntityTypeBotCommand\).

<a name="HasPhoto"></a>
## func [HasPhoto](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L94>)

```go
func HasPhoto() dispatch.Filter[*api.Message]
```

HasPhoto returns a Filter that matches messages with a Photo attachment.

<a name="InChat"></a>
## func [InChat](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L138>)

```go
func InChat(chatID int64) dispatch.Filter[*api.Message]
```

InChat returns a Filter that matches messages whose Chat.ID equals chatID.

<a name="IsForward"></a>
## func [IsForward](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L87>)

```go
func IsForward() dispatch.Filter[*api.Message]
```

IsForward returns a Filter that matches messages that have ForwardOrigin set.

<a name="IsReply"></a>
## func [IsReply](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L80>)

```go
func IsReply() dispatch.Filter[*api.Message]
```

IsReply returns a Filter that matches messages that have ReplyToMessage set.

<a name="Text"></a>
## func [Text](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L14>)

```go
func Text(pattern string) dispatch.Filter[*api.Message]
```

Text returns a Filter that matches messages whose Text matches pattern \(regex\). Panics at registration time on an invalid pattern.

<a name="TextContains"></a>
## func [TextContains](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L36>)

```go
func TextContains(sub string) dispatch.Filter[*api.Message]
```

TextContains returns a Filter that matches messages whose Text contains sub.

<a name="TextEquals"></a>
## func [TextEquals](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L22>)

```go
func TextEquals(s string) dispatch.Filter[*api.Message]
```

TextEquals returns a Filter that matches messages whose Text equals s exactly.

<a name="TextPrefix"></a>
## func [TextPrefix](<https://github.com/lukaszraczylo/go-telegram/blob/main/dispatch/filters/message/message.go#L29>)

```go
func TextPrefix(prefix string) dispatch.Filter[*api.Message]
```

TextPrefix returns a Filter that matches messages whose Text starts with prefix.

Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
