Public
Like
wikiapptry
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v17View latest version
This directory contains the database setup and query functions for the WhatsApp Wikipedia Bot.
Stores information about users who have interacted with the bot.
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| phone_number | TEXT | User's WhatsApp phone number (unique) |
| name | TEXT | User's name |
| preferred_content_type | TEXT | User's preferred content type (fact, audio, video) |
| last_interaction_time | INTEGER | Timestamp of last interaction |
| created_at | INTEGER | Timestamp when user was created |
Stores fun facts that can be sent to users.
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| topic | TEXT | Topic category of the fact |
| content | TEXT | The fact content |
| source | TEXT | Source of the fact |
| created_at | INTEGER | Timestamp when fact was added |
Stores audio clips that can be sent to users.
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| title | TEXT | Title of the audio clip |
| description | TEXT | Description of the audio clip |
| url | TEXT | URL to the audio file |
| topic | TEXT | Topic category of the audio |
| duration | INTEGER | Duration in seconds |
| created_at | INTEGER | Timestamp when audio was added |
Stores video clips that can be sent to users.
| Column | Type | Description |
|---|---|---|
| id | INTEGER | Primary key |
| title | TEXT | Title of the video clip |
| description | TEXT | Description of the video clip |
| url | TEXT | URL to the video file |
| topic | TEXT | Topic category of the video |
| duration | INTEGER | Duration in seconds |
| created_at | INTEGER | Timestamp when video was added |
When changing the schema, create a new table with an incremented version number (e.g., whatsapp_wiki_users_v2) rather than altering the existing table.