Skip to content

Commit 0678e14

Browse files
committed
AnyType -> Anytype
1 parent 6ce95da commit 0678e14

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

bot/handlers/whatsapp_location.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ import (
1616
)
1717

1818
// WhatsAppLocationHandler automatically captures WhatsApp location messages
19-
// and stores them in AnyType with coordinates, accuracy, and metadata.
19+
// and stores them in Anytype with coordinates, accuracy, and metadata.
2020
//
2121
// Environment Variables Required:
22-
// - ANYTYPE_API_KEY: The AnyType AppKey for authentication
23-
// - ANYTYPE_SPACE: The AnyType Space ID where locations will be stored
22+
// - ANYTYPE_API_KEY: The Anytype AppKey for authentication
23+
// - ANYTYPE_SPACE: The Anytype Space ID where locations will be stored
2424
//
25-
// The handler automatically creates a "WhatsAppLocation" type in AnyType
25+
// The handler automatically creates a "WhatsAppLocation" type in Anytype
2626
// if it doesn't exist, with fields for latitude, longitude, accuracy,
2727
// sender, chat ID, and timestamp.
2828
type WhatsAppLocationHandler struct {
@@ -38,8 +38,8 @@ func NewWhatsAppLocationHandler() *WhatsAppLocationHandler {
3838
}
3939

4040
func (h *WhatsAppLocationHandler) HandleMessage(msg *events.Message) error {
41-
if !h.isAnyTypeAvailable() {
42-
log.Debug("AnyType environment variables not available, ignoring")
41+
if !h.isAnytypeAvailable() {
42+
log.Debug("Anytype environment variables not available, ignoring")
4343
return nil
4444
}
4545

@@ -56,8 +56,8 @@ func (h *WhatsAppLocationHandler) HandleMessage(msg *events.Message) error {
5656
"accuracy", loc.AccuracyInMeters)
5757

5858
if h.client == nil {
59-
if err := h.initializeAnyType(); err != nil {
60-
return fmt.Errorf("failed to initialize AnyType client: %w", err)
59+
if err := h.initializeAnytype(); err != nil {
60+
return fmt.Errorf("failed to initialize Anytype client: %w", err)
6161
}
6262
}
6363

@@ -80,7 +80,7 @@ func (h *WhatsAppLocationHandler) HandleMessage(msg *events.Message) error {
8080
return nil
8181
}
8282

83-
func (*WhatsAppLocationHandler) isAnyTypeAvailable() bool {
83+
func (*WhatsAppLocationHandler) isAnytypeAvailable() bool {
8484
if os.Getenv("ANYTYPE_API_KEY") == "" {
8585
return false
8686
}
@@ -92,7 +92,7 @@ func (*WhatsAppLocationHandler) isAnyTypeAvailable() bool {
9292
return true
9393
}
9494

95-
func (h *WhatsAppLocationHandler) initializeAnyType() error {
95+
func (h *WhatsAppLocationHandler) initializeAnytype() error {
9696
apiKey := os.Getenv("ANYTYPE_API_KEY")
9797
if apiKey == "" {
9898
return fmt.Errorf("ANYTYPE_API_KEY environment variable is required")
@@ -226,7 +226,7 @@ func (h *WhatsAppLocationHandler) Topics() []string {
226226
func (h *WhatsAppLocationHandler) GetHelp() HandlerHelp {
227227
return HandlerHelp{
228228
Name: "WhatsApp Location",
229-
Description: "Automatically stores WhatsApp location messages in AnyType",
229+
Description: "Automatically stores WhatsApp location messages in Anytype",
230230
Usage: "Send a location message to WhatsApp",
231231
Examples: []string{"Share your location in any chat"},
232232
Category: "storage",

docs/handlers/whatsapp_location.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
# WhatsApp Location Handler
22

3-
The WhatsApp Location handler automatically captures location messages sent to WhatsApp and stores them in AnyType with coordinates, accuracy, and metadata.
3+
The WhatsApp Location handler automatically captures location messages sent to WhatsApp and stores them in Anytype with coordinates, accuracy, and metadata.
44

55
![WhatsApp Location Handler](/images/anytype-whatsapp.png)
66

77
## Overview
88

9-
This handler monitors all incoming WhatsApp messages for location data. When a location message is received, it automatically extracts the coordinates, accuracy information, and sender details, then stores this data in an AnyType workspace.
9+
This handler monitors all incoming WhatsApp messages for location data. When a location message is received, it automatically extracts the coordinates, accuracy information, and sender details, then stores this data in an Anytype workspace.
1010

1111
## Features
1212

1313
- **Automatic Location Capture**: Monitors all WhatsApp messages for location data
14-
- **AnyType Integration**: Stores locations in a structured format in AnyType
14+
- **Anytype Integration**: Stores locations in a structured format in Anytype
1515
- **Metadata Preservation**: Captures sender information and accuracy data
16-
- **Type Management**: Automatically creates the required AnyType object type if it doesn't exist
16+
- **Type Management**: Automatically creates the required Anytype object type if it doesn't exist
1717

1818
## Configuration
1919

2020
### Environment Variables
2121

2222
The handler requires two environment variables to function:
2323

24-
- `ANYTYPE_API_KEY`: The AnyType AppKey for authentication
25-
- `ANYTYPE_SPACE`: The AnyType Space ID where locations will be stored
24+
- `ANYTYPE_API_KEY`: The Anytype AppKey for authentication
25+
- `ANYTYPE_SPACE`: The Anytype Space ID where locations will be stored
2626

2727
If these environment variables are not set, the handler will silently ignore location messages.
2828

29-
### AnyType Setup
29+
### Anytype Setup
3030

31-
The handler connects to AnyType running on `localhost:31009` by default. Ensure your AnyType instance is running and accessible.
31+
The handler connects to Anytype running on `localhost:31009` by default. Ensure your Anytype instance is running and accessible.
3232

3333
## Data Structure
3434

35-
The handler creates a "WhatsApp Location" type in AnyType with the following fields:
35+
The handler creates a "WhatsApp Location" type in Anytype with the following fields:
3636

3737
- **User**: The WhatsApp user who sent the location (text field)
3838
- **Latitude**: Geographic latitude in degrees (number field)
@@ -48,7 +48,7 @@ The handler operates automatically in the background. To capture locations:
4848
1. Ensure the required environment variables are set
4949
2. Start the sup bot with the WhatsApp Location handler enabled
5050
3. Send or receive location messages in WhatsApp
51-
4. Locations will be automatically stored in your AnyType workspace
51+
4. Locations will be automatically stored in your Anytype workspace
5252

5353
## Handler Details
5454

@@ -61,9 +61,9 @@ The handler operates automatically in the background. To capture locations:
6161
### Common Issues
6262

6363
1. **Locations not being stored**: Verify environment variables are set correctly
64-
2. **AnyType connection errors**: Ensure AnyType is running on localhost:31009
65-
3. **Type creation failures**: Check AnyType API key permissions
64+
2. **Anytype connection errors**: Ensure Anytype is running on localhost:31009
65+
3. **Type creation failures**: Check Anytype API key permissions
6666

6767
### Debug Mode
6868

69-
Enable sup bot debug logging to see detailed information about location message processing and AnyType operations.
69+
Enable sup bot debug logging to see detailed information about location message processing and Anytype operations.

0 commit comments

Comments
 (0)