# Pico documentation Site: https://picogram.ir. Bot API base URL: https://picogram.ir/bot/. Online: https://docs.picogram.ir/ # User guide (English) ## Welcome to Pico Pico is a fast, private messenger. It runs in your browser, on your phone and on your computer, in English and Persian, with full right-to-left support. You can chat with friends, make groups and channels, send photos, videos, files and voice messages, and use bots. Open it Go to picogram.ir in any browser. There is nothing to download from a store. Install it like an app Android (Chrome): open the menu and choose Install app or Add to Home screen. You can also use Settings → Install Pico inside Pico. iPhone / iPad (Safari): tap Share, then Add to Home Screen. Computer (Chrome, Edge): click the install icon in the address bar. 🔔 Turn on notifications in Settings → Notifications to hear about new messages even when Pico is closed. ## Your account Creating an account Type your e-mail address and press Continue. Pico e-mails you a 6-digit code. Type it in (check the spam folder too). The code works for 10 minutes and only once. Choose your name, an optional username and a password of at least 8 characters. Your username is how people find you: @SorenaNet. It is shown exactly as you type it (capital letters included), while searching and links ignore case. It needs 4 to 32 letters, digits or underscores, must start with a letter, cannot end in bot and cannot contain pico, which is reserved for the team. Signing in Type your e-mail and choose how: With a code: we e-mail you a code and you are in. No password needed. With your password: type the e-mail and the password. Both open the whole account, private chats included. If you are already signed in on a device that has been signed in for more than a day, the code also appears in the Pico chat there. Change your password or e-mail Open the menu → Settings → Security. Change password asks for the old and the new one. Change e-mail asks for your password and the new address, then sends a code to the new address to confirm it. The old address gets a short warning e-mail. Your devices Settings → Devices lists every device that is signed in, with its last activity. End any of them, or all the others at once. If something looks unfamiliar, end it and change your password. 🛡 The Pico chat keeps you informed. The official Pico account tells you about every new sign-in (device and time, never an address), password changes, e-mail changes and ended sessions. Keep your e-mail account safe: anyone who controls your e-mail can ask for a sign-in code. Never give a code to anyone, not even to someone who says they work for Pico. ## Chatting Start a chat Press the pencil button, or type in the search box: a name, a @username, or a link like picogram.ir/#/u/name. Open the person and write. A chat appears in your list as soon as someone writes the first message. What you can do with a message Press and hold a message on a phone, or right-click it on a computer: Action | What it does | Reply | Quotes the message in your answer. On a phone you can also swipe the message. | Edit | Fix your own message; it shows edited. | Delete | Removes the message for everyone, without leaving any trace. Admins can delete in groups they manage. | Forward | Sends the message to another chat. | React | Double-tap, or pick an emoji. Up to 3 reactions per message. | Pin | Keeps an important message at the top of the chat. | Format your text Select text and use the T button, or type the marks yourself: You type | You get | **bold** | bold | __italic__ | italic | ++underline++ | underline | ~~strike~~ | strikethrough | ||secret|| | a spoiler that opens when tapped | `code` | monospace code | Emoji Emoji look like Apple's on every device. Press the smiley next to the message box to pick one. Saved Messages Your own private notebook, pinned at the top of the list. Send yourself notes, links, photos and files, and open them on any of your devices. ## Photos, videos, files and voice Press the paperclip to send photos, videos or any file. You can add a caption, and send several at once. The limit is 200 MB per file (a file just a hair over still goes through). Big files are sent in small pieces: if your connection drops, only the piece in progress is repeated. A progress ring shows on the message and you can cancel it. For a voice message, use the microphone button next to the message box: record, then send it (or cancel). Tap a photo to see it full size, tap a file to save it. 📶 On a slow connection, wait for the ring to finish before closing the app. ## Your chat list The tabs on top filter the list: All, Unread, Private, Groups, Channels, Bots. The official Pico account stays in All only. Press and hold a chat (right-click on a computer) for the menu: Pin up to 5 chats to the top. Mute for 1 hour, 8 hours, 2 days or for ever. Archive a chat: it moves to Archived chats (the row at the top of the list). Mark as unread / read. Delete the chat. A half-written message is kept as a draft and shows in red in the list. ## Groups and channels A group is a chat where everyone can write. A channel is for broadcasting: only admins post and everyone else reads. Press the pencil button and choose New group or New channel, give it a name, a picture and (optionally) a description. Public or private Public: give it a username. Anyone can find it by searching and join. Private: no username. People join with the invite link you share. You can reset the link at any time, which stops the old one. Approve new members For a private group or channel turn on Approve new members (edit the chat). People who open the link then send a request, and the owner or admins with the invite right accept or decline them. It is not available for public chats. Admins The owner can make admins and choose exactly what each may do: change info, post, edit messages, delete messages, ban people, invite, pin, add admins. The owner can hand the group over to someone else (you confirm with your password). In groups you can also set what ordinary members may do: send messages, send media, add people, pin, change info. Banning A banned person cannot join again, not even with the link, until an admin unbans them in the chat info. ## Privacy and safety Encryption Private chats between two people, and your Saved Messages, are encrypted with keys tied to the accounts. Groups, channels and bots are protected on the way and in storage, but they are not private chats: treat them like a room. No screen in Pico, including the admin panel, shows what people write. No addresses kept Pico does not store or show IP addresses, and its logs do not keep who connected. E-mail addresses are stored scrambled, not as text. Last seen Settings → Privacy and security lets you show your last-seen time to everybody, only to contacts, or to nobody. Blocking Open a person and choose Block. They can still type to you, but their messages never reach you, and they see you as "last seen a long time ago". Unblock them any time; what they sent while blocked stays hidden. Reporting Use Report on a message or a profile. A reported message shares only its own text with the Pico team. Fake "Pico" accounts Nobody but the team may call themselves "Pico Support" or "Pico Admin". The only official accounts are the verified ones listed in the next section. The team never asks for your code or password. ## Official accounts and bots Bots are small helper programs you chat with. The verified (blue tick) official ones are: Account | What it does | Pico | Notices about your account: new sign-ins, password and e-mail changes, sign-in codes. You cannot reply to it. | @botfather | Makes and manages bots (for developers). | @spambot | Tells you if your account has limits and lets you appeal. | @bluetick | Request a blue tick for an account, channel, group or bot. | @support | Write to the Pico team; a person answers in the same chat. | @infobot | Shows your account details, or the public details of any @username. | @deleteaccount | The official way to delete your account (see the next section). | Other bots are made by people outside Pico: only add the ones you trust, and never type your password or a sign-in code into a bot. ## Deleting your account Open @deleteaccount and press Delete my account. The bot e-mails a 6-digit code to the address of your account; send the code back and the account is deleted for good. (Settings → Delete account works too and asks for your password.) What is removed Your profile, settings, devices, bots and private chats. Messages you wrote in groups and channels may stay without your name, and groups you own stay without an owner. It cannot be undone. The safety rules A device that signed in less than 24 hours ago has to wait before it can delete the account, so a stolen or borrowed session cannot wipe it at once. The bot tells you how long is left. The device that created the account is not delayed. One e-mail address can delete its account at most twice in 24 hours. Right after a deletion the same address is free: you can open a new account with it straight away. 👋 If you only want a break, you can just sign out. Nothing is deleted. ## Settings and looks Language: English or Persian, switched instantly, with the whole layout flipping to right-to-left. Theme: light, dark or black. Time zone: times can follow Tehran or your device. Notifications: allow or stop push notifications for this device. Profile: name, bio, picture and username. A bio is shown line by line, each line in its own direction. ## FAQ **Is Pico free?** Yes. You use it in your browser or install it as an app, for free. **I did not get the code. What now?** Wait a minute, check the spam folder, and press "send again". Make sure the address has no typo. A code works for 10 minutes and only once. **I forgot my password.** Sign in with a code instead: choose "Sign in with a code", then set a new password in Settings → Security. **What is the biggest file I can send?** 200 MB per file. **Can I use Pico on two devices?** Yes. Sign in on each one; see and end them in Settings → Devices. **Why do my private chats say they are locked?** On a device where you signed in with a code before the key was saved, tap the banner and type your password once. **How do I report a problem?** Write to @support. A person from the Pico team answers in the same chat. # Developer docs (English) ## What is a Pico bot? A bot is a small program that talks to people on Pico like a normal contact. You write it in any programming language, run it wherever you like, and it talks to Pico over a simple HTTPS API. The Bot API follows the same shape as Telegram's, so if you have written a Telegram bot before, you already know most of it. 🎉 🏠 Where does the code run? On your own computer, a server, a VPS or a cloud function. Pico delivers the messages to your program and sends back what it answers. Pico does not run your code for you (yet). ## Quick start Create the bot. In Pico open @botfather and send /newbot. Choose a name and a username that ends in bot. Copy the token. BotFather sends a token like 123456:AbCdEf-your-token. Tap it to copy. You can see it again whenever you want: /mybots → your bot → 🔑 API token. Say hello to your bot. Open it and press Start. Bots can never message someone who has not written to them first. Run a program. Use one of the examples below, put your token in, and write to your bot. 🎈 curlPythonNode.jsPHPGo Copycurl "https://picogram.ir/bot123456:AbCdEf-your-token/getMe" curl -X POST "https://picogram.ir/bot123456:AbCdEf-your-token/sendMessage" \ -H "content-type: application/json" \ -d '{"chat_id": 42, "text": "Hello from my bot 👋"}' curl Copyimport requests TOKEN = "123456:AbCdEf-your-token" API = f"https://picogram.ir/bot{TOKEN}" offset = 0 while True: r = requests.get(f"{API}/getUpdates", params={"offset": offset, "timeout": 30}, timeout=40).json() for u in r["result"]: offset = u["update_id"] + 1 m = u.get("message") if m and m.get("text"): requests.post(f"{API}/sendMessage", json={"chat_id": m["chat"]["id"], "text": f"You said: {m['text']}"}) Python Copyconst TOKEN = "123456:AbCdEf-your-token"; const API = `https://picogram.ir/bot${TOKEN}`; let offset = 0; for (;;) { const r = await (await fetch(`${API}/getUpdates?offset=${offset}&timeout=30`)).json(); for (const u of r.result) { offset = u.update_id + 1; const m = u.message; if (m?.text) { await fetch(`${API}/sendMessage`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ chat_id: m.chat.id, text: `You said: ${m.text}` }), }); } } } Node.js Copy $m["chat"]["id"], "text" => "You said: " . $m["text"], ])); } } } PHP Copypackage main import ( "encoding/json" "fmt" "net/http" "net/url" "strings" ) const api = "https://picogram.ir/bot123456:AbCdEf-your-token" func main() { offset := 0 for { resp, err := http.Get(fmt.Sprintf("%s/getUpdates?offset=%d&timeout=30", api, offset)) if err != nil { continue } var out struct { Result []struct { UpdateID int `json:"update_id"` Message *struct { Text string `json:"text"` Chat struct{ ID int `json:"id"` } `json:"chat"` } `json:"message"` } `json:"result"` } json.NewDecoder(resp.Body).Decode(&out) resp.Body.Close() for _, u := range out.Result { offset = u.UpdateID + 1 if u.Message != nil && u.Message.Text != "" { http.PostForm(api+"/sendMessage", url.Values{ "chat_id": {fmt.Sprint(u.Message.Chat.ID)}, "text": {"You said: " + strings.TrimSpace(u.Message.Text)}}) } } } } Go 🔑 The token is a password. Never put it in a public repository or in a web page. ## How to connect Every request goes to: Copyhttps://picogram.ir/bot/ URL 🔒 HTTPS only. 📨 Send parameters as a query string, as a JSON body (content-type: application/json) or both. GET and POST both work. 📦 The answer is always JSON: {"ok": true, "result": …} on success, or {"ok": false, "error_code": 400, "description": "…"} on failure. 🐢 Rate limit: 600 requests per minute per IP address. Telegram libraries Most Telegram bot libraries let you change the API address. Point them at Pico and they work for every method listed on this page. Methods Pico does not have yet answer with an error. Copy# python-telegram-bot Application.builder().token(TOKEN).base_url("https://picogram.ir/bot").build() # aiogram 3 AiohttpSession(api=TelegramAPIServer.from_base("https://picogram.ir")) # grammY new Bot(TOKEN, { client: { apiRoot: "https://picogram.ir" } }) # Telegraf new Telegraf(TOKEN, { telegram: { apiRoot: "https://picogram.ir" } }) # node-telegram-bot-api new TelegramBot(TOKEN, { polling: true, baseApiUrl: "https://picogram.ir" }) Libraries ## Languages and formats Pico does not care what you write your bot in. If your language can make an HTTPS request and read JSON, it works: Python, JavaScript / TypeScript (Node, Deno, Bun), PHP, Go, Java, Kotlin, C#, Rust, Ruby, Dart, Swift, shell scripts… 🌍 | Accepted | 📡 Transport | HTTPS (TLS 1.2+) | 📝 Request | query string, JSON body (application/json), or both | 📤 Response | JSON, UTF-8 | 🔤 Text | UTF-8, 1 to 4096 characters per message | 🔁 Getting messages | long polling with getUpdates or a webhook | ## Methods Method | Parameters | What it does | getMe | — | Your bot's id, name and username. | getUpdates | offset, timeout (0–50 s), limit (1–100) | Long polling. Pass offset = last update_id + 1 to confirm what you already handled. | sendMessage | chat_id, text, parse_mode, reply_to_message_id, reply_markup | Sends a text message. | editMessageText | chat_id, message_id, text, parse_mode, reply_markup | Edits a message your bot sent. | deleteMessage | chat_id, message_id | Deletes a message your bot sent. | answerCallbackQuery | callback_query_id | Tells Pico you handled a button tap. | sendChatAction | chat_id, action | Accepted so existing code keeps working. | setMyCommands / getMyCommands | commands: JSON list of {command, description} (up to 100) | The /commands menu of your bot. Commands are lowercase letters, digits and underscores. | getChat | chat_id | Basic info about a chat. | setWebhook / deleteWebhook / getWebhookInfo | url, secret_token | Receive updates by webhook instead of polling. | 🧭 chat_id is the number you find in message.chat.id of an update. ## Photos, videos and files Your bot can send everything people can send in Pico, and receive it too. Method | File parameter | Shown as | sendPhoto | photo | a photo | sendVideo | video | a video that plays inside the chat | sendAnimation | animation | a looping video or a GIF | sendAudio | audio | an audio file | sendVoice | voice | a voice message with a waveform | sendDocument | document | any other file | sendLocation, sendContact, sendDice | — | a tappable map link, a contact card, a dice roll 🎲 | Every one of them also takes chat_id, caption (up to 1024 characters), parse_mode, reply_to_message_id and reply_markup. For videos and voice you can add duration, width and height. The file itself can be given in three ways: Copy# 1) upload a file from your computer (multipart/form-data) curl -F chat_id=42 -F caption="Look 👀" -F photo=@cat.jpg "https://picogram.ir/bot123456:AbCdEf-your-token/sendPhoto" # 2) send a file Pico already has (a file_id from an update or an earlier message) curl "https://picogram.ir/bot123456:AbCdEf-your-token/sendDocument" -d chat_id=42 -d document= # 3) let Pico download a public https link for you curl "https://picogram.ir/bot123456:AbCdEf-your-token/sendVideo" -d chat_id=42 --data-urlencode "video=https://example.com/clip.mp4" # receive: getFile gives a path, then download it curl "https://picogram.ir/bot123456:AbCdEf-your-token/getFile?file_id=" curl -O "https://picogram.ir/file/bot123456:AbCdEf-your-token/files/" curl 📤 Upload with multipart/form-data (one file per request). 🆔 A file_id that Pico gave you, to send the same file again without uploading it. 🔗 A public https link: Pico downloads it for you (up to 50 MB, public addresses only). Receiving files When someone sends your bot a photo, video, voice message or file, the update has the matching field (photo, video, voice, document), a file_id, and the caption. Copy{ "update_id": 120, "message": { "message_id": 940, "from": { "id": 7, "is_bot": false, "first_name": "Sara" }, "chat": { "id": 42, "type": "private" }, "caption": "my cat", "photo": [ { "file_id": "k2s9…", "width": 1280, "height": 960, "file_size": 183412 } ] } } JSON Call getFile to get a file_path, then download https://picogram.ir/file/bot/. The largest file is 200 MB (50 MB for uploads and links from a bot). Forward, copy and edit forwardMessage and copyMessage (chat_id, from_chat_id, message_id), editMessageCaption, editMessageReplyMarkup, pinChatMessage and unpinChatMessage. ## Groups, channels and admin methods Add your bot to a group or channel, make it an admin with the rights it needs, and it can manage the chat. Method | Needs the right | What it does | getChatMember | — | Status of a person: creator, administrator, member, left or kicked, with their rights. | getChatAdministrators | — | The owner and all admins. | getChatMemberCount | — | How many members. | banChatMember / unbanChatMember | ban | Remove and block someone from coming back, or let them return. | setChatTitle / setChatDescription | info | Change the name or description. | pinChatMessage / unpinChatMessage | pin | Pin or unpin a message. | leaveChat | — | The bot leaves. | promoteChatMember | admins | Make someone an admin with can_change_info, can_post_messages, can_edit_messages, can_delete_messages, can_restrict_members, can_invite_users, can_pin_messages, can_promote_members (never more than the bot has itself). | setChatPermissions | ban | What ordinary group members may do. | exportChatInviteLink / createChatInviteLink / revokeChatInviteLink | invite | Get or reset the invite link. | setChatPhoto / deleteChatPhoto | info | Change the picture. | unpinAllChatMessages | pin | Remove every pin. | deleteMessages, forwardMessages, copyMessages, sendMediaGroup | — | Several messages at once; an album of up to 10 photos, videos, audio files or documents. | Admin rights Owners and admins give people (and bots) exactly the rights they need: change info, post messages (channels), edit and delete messages, ban people, invite people, pin messages and add new admins. The owner can also hand the chat over to someone else, and set what ordinary members of a group may do (send messages, send media, add people, pin, change info). Your bot's profile setMyName, getMyName, setMyDescription, getMyDescription. Change its picture in @botfather: /mybots → your bot → 📷 Edit picture. Button answers answerCallbackQuery with text shows a short message to the person who tapped the button. Membership updates When your bot is added to or removed from a group or channel it gets a my_chat_member update with the old and new status (member, left or kicked). ## Updates: what your bot receives Every item from getUpdates (or every webhook call) has an update_id and one of two things: 💬 A message Copy{ "update_id": 118, "message": { "message_id": 931, "from": { "id": 7, "is_bot": false, "first_name": "Sara", "username": "sara" }, "date": 1767225600, "text": "hello", "chat": { "id": 42, "type": "private" } } } JSON text is the plain text. If the person used formatting, formatted_text also contains the original with Pico's formatting symbols. 👆 A button tap Copy{ "update_id": 119, "callback_query": { "id": "931.1767225700000", "from": { "id": 7, "is_bot": false, "first_name": "Sara", "username": "sara" }, "data": "yes", "message": { "message_id": 931, "chat": { "id": 42, "type": "private" }, "text": "Pick one" } } } JSON In groups and channels a bot only sees commands (/start), messages that mention it (@yourbot) and replies to its own messages. ⏳ Updates you do not confirm are kept for 24 hours. ## Formatting text Add parse_mode to sendMessage and editMessageText: HTML, MarkdownV2 or Markdown, exactly like Telegram. Without it the text is sent as typed. HTML Copybold italic underline strike spoiler link inline code
print("hi")
quote
HTML MarkdownV2 Copy*bold* _italic_ __underline__ ~strike~ ||spoiler|| [link](https://picogram.ir) `inline code` ```python print("hi") ``` >quote (escape these with a backslash: _ * [ ] ( ) ~ ` > # + - = | { } . !) MarkdownV2 Pico supports bold, italic, underline, strikethrough, spoiler, inline code, code blocks with a language, links, and block quotes (also collapsible ones with
). Mentions (@name), hashtags, links, e-mail addresses and /commands are recognised automatically. If the formatting is broken you get 400 can't parse entities. ✨ People can format their own messages too: select text and use the T button, or type **bold** __italic__ ++underline++ ~~strike~~ ||spoiler||. ## Buttons (inline keyboards) Add reply_markup to a message to show buttons under it. A button has either callback_data (your bot gets a callback_query when it is tapped) or a url (opens a link). Copy{ "chat_id": 42, "text": "Pick one 👇", "reply_markup": { "inline_keyboard": [ [ { "text": "✅ Yes", "callback_data": "yes" }, { "text": "❌ No", "callback_data": "no" } ], [ { "text": "🌐 Website", "url": "https://example.com" } ] ] } } JSON Limit | Value | Rows | up to 8 | Buttons per row | up to 8 | Button text | 1–64 characters | callback_data | up to 64 characters | url | http(s) links only | 🎯 Design tip: two buttons per row look best on phones. Use one per row only for long labels. When someone taps a button, call answerCallbackQuery and then editMessageText to update the message, or send a new one. Reply keyboards Besides buttons under a message, reply_markup can show keys above the message box. Tapping a key sends its text as a normal message. Copy{ "keyboard": [[{"text":"One"},{"text":"Two"}],[{"text":"Cancel"}]], "resize_keyboard": true, "one_time_keyboard": true, "input_field_placeholder": "Choose…" } JSON one_time_keyboard: the keys hide after one tap (people can bring them back with the keyboard button). {"remove_keyboard": true}: removes the keys. {"force_reply": true}: the message box replies to your message straight away. ## Webhooks Instead of polling, Pico can call your server whenever something happens. Copycurl "https://picogram.ir/bot123456:AbCdEf-your-token/setWebhook" \ --data-urlencode "url=https://bot.example.com/pico-hook" \ --data-urlencode "secret_token=my_secret_123" curl 🔒 The address must be https on port 443 or 8443, and must resolve to a public address. 🔑 If you set secret_token, every call carries the header X-Pico-Bot-Api-Secret-Token. Check it. 📮 Pico sends the update as JSON in a POST. Answer with 2xx within 10 seconds. 🔁 A failed delivery is tried 3 times (now, after 1.5 s, after 8 s). getWebhookInfo shows the last error. ⚠️ While a webhook is set, getUpdates answers 409 Conflict. Call deleteWebhook to go back to polling. ## Rules and limits Topic | Rule | Username | Ends in bot, 4–32 letters, digits or underscores, starts with a letter. Names containing pico are reserved for the Pico team. | Starting a chat | A bot can only write to people who wrote to it first. | Groups and channels | Bots see commands, mentions and replies to themselves. | Encryption | Chats with bots, groups and channels are not private chats: they are protected in transit and in storage. Private chats between two people are encrypted with keys tied to their accounts. | Message size | 1–4096 characters. | Request rate | 600 requests per minute per IP. | Kept updates | 24 hours. | 🚧 Not available yet Inline mode (answerInlineQuery), payments, games, polls, stickers, sendVideoNote, commands per language or scope, and Mini Apps. Tell us what you need through @support in Pico. 💙 ## Errors Code | Meaning | What to do | 401 | Unauthorized | The token is wrong or was revoked. Check it in BotFather. | 400 | Bad Request | A parameter is missing or invalid, or the formatting cannot be parsed. Read description. | 403 | Forbidden | The bot is not in that chat, or the person has not written to the bot first. | 404 | Not Found | The method does not exist (yet). | 409 | Conflict | A webhook is set. Use deleteWebhook or use the webhook. | 429/5xx | Slow down / server problem | Wait a moment and try again. | # راهنمای کاربران (فارسی) ## به پیکو خوش آمدید پیکو یک پیام‌رسان سریع و خصوصی است. در مرورگر، روی گوشی و روی کامپیوتر اجرا می‌شود، فارسی و انگلیسی را کامل و با چیدمان راست‌به‌چپ پشتیبانی می‌کند و می‌توانید با دوستانتان گفتگو کنید، گروه و کانال بسازید، عکس، فیلم، فایل و پیام صوتی بفرستید و از ربات‌ها استفاده کنید. بازکردن در هر مرورگری به picogram.ir بروید. چیزی لازم نیست از فروشگاه برنامه دانلود کنید. نصب مثل یک برنامه اندروید (کروم): از منو Install app یا Add to Home screen را بزنید. از تنظیمات ← نصب پیکو داخل خود پیکو هم می‌شود. آیفون و آیپد (سافاری): دکمه‌ی Share و بعد Add to Home Screen را بزنید. کامپیوتر (کروم، اج): روی آیکن نصب در نوار آدرس کلیک کنید. 🔔 در تنظیمات ← اعلان‌ها اعلان‌ها را روشن کنید تا حتی وقتی پیکو بسته است از پیام‌های تازه باخبر شوید. ## حساب شما ساخت حساب ایمیل خود را بنویسید و ادامه را بزنید. پیکو یک کد ۶ رقمی برایتان ایمیل می‌کند. آن را وارد کنید (پوشه‌ی اسپم را هم نگاه کنید). کد ۱۰ دقیقه اعتبار دارد و فقط یک بار کار می‌کند. نام، یک نام کاربری (دلخواه) و رمز عبور حداقل ۸ نویسه‌ای انتخاب کنید. نام کاربری راهی است که مردم شما را پیدا می‌کنند: @SorenaNet. دقیقاً همان‌طور که می‌نویسید (با حروف بزرگ) نشان داده می‌شود، اما جست‌وجو و لینک‌ها به بزرگی و کوچکی حروف توجه نمی‌کنند. باید ۴ تا ۳۲ حرف، رقم یا زیرخط باشد، با حرف شروع شود، به bot ختم نشود و pico نداشته باشد، چون برای تیم پیکو رزرو است. ورود ایمیلتان را بنویسید و راه ورود را انتخاب کنید: با کد: یک کد برایتان ایمیل می‌کنیم و وارد می‌شوید. رمز عبور لازم نیست. با رمز عبور: ایمیل و رمز عبور را بنویسید. هر دو راه کل حساب، از جمله گفتگوهای خصوصی، را باز می‌کنند. اگر روی دستگاهی هستید که بیش از یک روز است وارد شده، کد در گفتگوی پیکو همان دستگاه هم دیده می‌شود. تغییر رمز عبور و ایمیل منو ← تنظیمات ← امنیت. تغییر رمز عبور رمز قدیمی و تازه را می‌خواهد. تغییر ایمیل رمز عبور و نشانی تازه را می‌خواهد و یک کد به نشانی تازه می‌فرستد تا تأییدش کنید. نشانی قدیمی هم یک ایمیل هشدار کوتاه می‌گیرد. دستگاه‌های شما تنظیمات ← دستگاه‌ها همه‌ی دستگاه‌های واردشده را با آخرین فعالیتشان نشان می‌دهد. می‌توانید هرکدام یا همه‌ی دیگران را ببندید. اگر چیزی ناآشنا دیدید، آن را ببندید و رمز عبور را عوض کنید. 🛡 گفتگوی پیکو شما را باخبر نگه می‌دارد. حساب رسمی پیکو هر ورود تازه (دستگاه و زمان، نه آدرس)، تغییر رمز عبور، تغییر ایمیل و بسته‌شدن نشست‌ها را به شما خبر می‌دهد. از حساب ایمیل خود مراقبت کنید: هر کس به ایمیل شما دسترسی داشته باشد می‌تواند کد ورود بخواهد. کد را به هیچ‌کس ندهید، حتی اگر بگوید از طرف پیکو آمده است. ## گفتگو شروع یک گفتگو دکمه‌ی مداد را بزنید، یا در جعبه‌ی جست‌وجو یک نام، یک @نام‌کاربری یا لینکی مثل picogram.ir/#/u/name بنویسید. فرد را باز کنید و بنویسید. گفتگو وقتی در فهرستتان می‌آید که اولین پیام فرستاده شود. کارهایی که با یک پیام می‌توانید بکنید روی گوشی پیام را نگه دارید، روی کامپیوتر راست‌کلیک کنید: کار | چه می‌کند | پاسخ | پیام را در جواب شما نقل می‌کند. روی گوشی می‌توانید پیام را بکشید هم. | ویرایش | پیام خودتان را درست کنید؛ برچسب ویرایش‌شده می‌خورد. | حذف | پیام را برای همه و بدون هیچ ردپایی پاک می‌کند. ادمین‌ها در گروه‌های خودشان می‌توانند حذف کنند. | هدایت | پیام را به گفتگوی دیگری می‌فرستد. | واکنش | دوبار ضربه بزنید یا یک ایموجی انتخاب کنید. تا ۳ واکنش برای هر پیام. | سنجاق | پیام مهم را بالای گفتگو نگه می‌دارد. | قالب‌بندی متن متن را انتخاب کنید و دکمه‌ی T را بزنید، یا خودتان نشانه‌ها را بنویسید: می‌نویسید | می‌شود | **درشت** | درشت | __کج__ | کج | ++زیرخط++ | زیرخط‌دار | ~~خط‌خورده~~ | خط‌خورده | ||راز|| | متن پنهان که با ضربه باز می‌شود | `کد` | کد با قلم تک‌فاصله | ایموجی ایموجی‌ها روی همه‌ی دستگاه‌ها مثل ایموجی اپل دیده می‌شوند. برای انتخاب، روی صورتک کنار کادر پیام بزنید. پیام‌های ذخیره‌شده دفترچه‌ی شخصی خودتان که بالای فهرست سنجاق است. یادداشت، لینک، عکس و فایل برای خودتان بفرستید و روی هر دستگاهتان باز کنید. ## عکس، فیلم، فایل و صدا برای فرستادن عکس، فیلم یا هر فایلی گیره‌ی کاغذ را بزنید. می‌توانید توضیح اضافه کنید و چندتا را با هم بفرستید. سقف هر فایل ۲۰۰ مگابایت است (فایلی که کمی بیشتر باشد هم رد می‌شود). فایل‌های بزرگ تکه‌تکه فرستاده می‌شوند: اگر اینترنت قطع شود فقط تکه‌ی در حال ارسال تکرار می‌شود. روی پیام یک حلقه‌ی پیشرفت می‌بینید و می‌توانید لغوش کنید. برای پیام صوتی از دکمه‌ی میکروفون کنار کادر پیام استفاده کنید: ضبط کنید و بعد بفرستید (یا لغو کنید). روی عکس بزنید تا بزرگ ببینید، روی فایل بزنید تا ذخیره شود. 📶 اگر اینترنت کند است، تا پایان حلقه‌ی ارسال برنامه را نبندید. ## فهرست گفتگوها زبانه‌های بالا فهرست را فیلتر می‌کنند: همه، خوانده‌نشده، افراد، گروه‌ها، کانال‌ها، ربات‌ها. حساب رسمی پیکو فقط در «همه» می‌آید. یک گفتگو را نگه دارید (روی کامپیوتر راست‌کلیک) تا منو باز شود: سنجاق تا ۵ گفتگو در بالای فهرست. بی‌صدا برای ۱ ساعت، ۸ ساعت، ۲ روز یا همیشه. بایگانی: گفتگو به گفتگوهای بایگانی‌شده (ردیف بالای فهرست) می‌رود. علامت خوانده‌شده / خوانده‌نشده. حذف گفتگو. پیامِ نیمه‌نوشته به‌صورت پیش‌نویس نگه داشته می‌شود و در فهرست با رنگ قرمز دیده می‌شود. ## گروه و کانال گروه گفتگویی است که همه می‌توانند در آن بنویسند. کانال برای پخش پیام است: فقط ادمین‌ها پیام می‌گذارند و بقیه می‌خوانند. دکمه‌ی مداد را بزنید و گروه جدید یا کانال جدید را انتخاب کنید و نام، تصویر و (دلخواه) توضیح بدهید. عمومی یا خصوصی عمومی: یک نام کاربری بدهید. هر کس با جست‌وجو پیدایش می‌کند و می‌پیوندد. خصوصی: بدون نام کاربری. مردم با لینک دعوتی که می‌فرستید می‌پیوندند. هر وقت بخواهید لینک را بازنشانی می‌کنید و لینک قبلی از کار می‌افتد. تأیید اعضای جدید برای گروه یا کانال خصوصی گزینه‌ی تأیید اعضای جدید را روشن کنید (ویرایش گفتگو). کسانی که لینک را باز می‌کنند فقط درخواست می‌فرستند و مالک یا ادمین‌هایی که حق دعوت دارند می‌پذیرند یا رد می‌کنند. برای گفتگوهای عمومی وجود ندارد. ادمین‌ها مالک می‌تواند ادمین بگذارد و دقیقاً مشخص کند هرکدام چه کارهایی بکنند: تغییر اطلاعات، ارسال پیام، ویرایش پیام‌ها، حذف پیام‌ها، مسدودکردن افراد، دعوت، سنجاق، افزودن ادمین. مالک می‌تواند گروه را به شخص دیگری بسپارد (با رمز عبور تأیید می‌کنید). در گروه‌ها می‌توانید تعیین کنید اعضای عادی چه کارهایی بکنند: ارسال پیام، ارسال رسانه، افزودن افراد، سنجاق، تغییر اطلاعات. مسدودکردن فرد مسدودشده دیگر نمی‌تواند بپیوندد، حتی با لینک، تا وقتی ادمین در اطلاعات گفتگو او را آزاد کند. ## حریم خصوصی و امنیت رمزنگاری گفتگوی خصوصی بین دو نفر و پیام‌های ذخیره‌شده‌ی شما با کلیدهایی وابسته به حساب‌ها رمزنگاری می‌شوند. گروه‌ها، کانال‌ها و ربات‌ها هنگام انتقال و ذخیره محافظت می‌شوند اما گفتگوی خصوصی نیستند: مثل یک اتاق با آن‌ها رفتار کنید. هیچ صفحه‌ای در پیکو، از جمله پنل مدیریت، آنچه مردم می‌نویسند را نشان نمی‌دهد. آدرسی نگه داشته نمی‌شود پیکو آدرس IP را ذخیره یا نمایش نمی‌دهد و لاگ‌هایش نگه نمی‌دارند چه کسی وصل شده. ایمیل‌ها به‌صورت درهم ذخیره می‌شوند، نه متن ساده. آخرین بازدید تنظیمات ← حریم خصوصی و امنیت اجازه می‌دهد زمان آخرین بازدیدتان را به همه، فقط به مخاطبان یا به هیچ‌کس نشان دهید. مسدودکردن فرد را باز کنید و مسدود را بزنید. او هنوز می‌تواند برایتان بنویسد، اما پیام‌هایش هرگز به شما نمی‌رسد و شما را «آخرین بازدید خیلی وقت پیش» می‌بیند. هر وقت بخواهید آزادش می‌کنید؛ پیام‌هایی که در زمان مسدودی فرستاده پنهان می‌ماند. گزارش روی یک پیام یا نمایه گزارش را بزنید. از پیام گزارش‌شده فقط همان متن برای تیم پیکو فرستاده می‌شود. حساب‌های جعلی «پیکو» هیچ‌کس جز تیم حق ندارد خودش را «Pico Support» یا «Pico Admin» بنامد. تنها حساب‌های رسمی همان‌هایی هستند که تیک آبی دارند و در بخش بعد آمده‌اند. تیم پیکو هرگز کد یا رمز عبور شما را نمی‌خواهد. ## حساب‌ها و ربات‌های رسمی ربات‌ها برنامه‌های کمکی کوچکی هستند که با آن‌ها گفتگو می‌کنید. ربات‌های رسمیِ تأییدشده (با تیک آبی) این‌ها هستند: حساب | چه می‌کند | پیکو | خبرهای حساب شما: ورودهای تازه، تغییر رمز عبور و ایمیل، کدهای ورود. نمی‌توانید به آن پاسخ دهید. | @botfather | ساخت و مدیریت ربات (برای برنامه‌نویسان). | @spambot | می‌گوید حسابتان محدودیت دارد یا نه و اجازه‌ی اعتراض می‌دهد. | @bluetick | درخواست تیک آبی برای حساب، کانال، گروه یا ربات. | @support | به تیم پیکو بنویسید؛ یک نفر در همان گفتگو پاسخ می‌دهد. | @infobot | مشخصات حساب شما، یا اطلاعات عمومی هر @username را نشان می‌دهد. | @deleteaccount | راه رسمی حذف حساب (بخش بعد را ببینید). | ربات‌های دیگر را کسانی بیرون از پیکو ساخته‌اند: فقط آن‌هایی را اضافه کنید که به آن‌ها اعتماد دارید و هرگز رمز عبور یا کد ورود را در گفتگو با یک ربات ننویسید. ## حذف حساب @deleteaccount را باز کنید و حذف حساب من را بزنید. ربات یک کد ۶ رقمی به ایمیل حساب شما می‌فرستد؛ کد را بفرستید تا حساب برای همیشه حذف شود. (تنظیمات ← حذف حساب هم کار می‌کند و رمز عبور می‌خواهد.) چه چیزی پاک می‌شود نمایه، تنظیمات، دستگاه‌ها، ربات‌ها و گفتگوهای خصوصی شما. پیام‌هایی که در گروه‌ها و کانال‌ها نوشته‌اید ممکن است بدون نام شما بمانند و گروه‌هایی که مالکشان هستید بدون مالک می‌مانند. برگشتی ندارد. قانون‌های ایمنی دستگاهی که کمتر از ۲۴ ساعت پیش وارد شده باید صبر کند تا بتواند حساب را حذف کند، تا نشست دزدیده‌شده یا قرضی نتواند یکباره آن را پاک کند. ربات می‌گوید چقدر مانده است. دستگاهی که حساب را ساخته معطل نمی‌شود. هر ایمیل در ۲۴ ساعت حداکثر دو بار می‌تواند حسابش را حذف کند. بلافاصله بعد از حذف، همان ایمیل آزاد است و می‌توانید فوراً با آن حساب تازه بسازید. 👋 اگر فقط می‌خواهید استراحت کنید، کافی است از حساب خارج شوید. چیزی حذف نمی‌شود. ## تنظیمات و ظاهر زبان: فارسی یا انگلیسی، بی‌درنگ عوض می‌شود و کل چیدمان راست‌به‌چپ می‌شود. پوسته: روشن، تیره یا سیاه. منطقه‌ی زمانی: ساعت‌ها می‌توانند طبق تهران یا طبق دستگاهتان باشند. اعلان‌ها: اعلان فوری را برای این دستگاه روشن یا خاموش کنید. نمایه: نام، بیوگرافی، تصویر و نام کاربری. بیوگرافی خط‌به‌خط نشان داده می‌شود و جهت هر خط از خودش است. ## پرسش‌های پرتکرار **پیکو رایگان است؟** بله. در مرورگر یا به‌صورت برنامه‌ی نصب‌شده، رایگان از آن استفاده می‌کنید. **کد به دستم نرسید، چه کنم؟** یک دقیقه صبر کنید، پوشه‌ی اسپم را ببینید و «ارسال دوباره» را بزنید. مطمئن شوید نشانی غلط‌نویسی ندارد. کد ۱۰ دقیقه اعتبار دارد و فقط یک بار. **رمز عبورم را فراموش کرده‌ام.** به‌جایش با کد وارد شوید: «ورود با کد» را بزنید، بعد در تنظیمات ← امنیت رمز عبور تازه بگذارید. **بزرگ‌ترین فایل چقدر می‌تواند باشد؟** هر فایل تا ۲۰۰ مگابایت. **می‌توانم روی دو دستگاه از پیکو استفاده کنم؟** بله. روی هرکدام وارد شوید؛ در تنظیمات ← دستگاه‌ها می‌بینید و می‌بندیدشان. **چرا گفتگوهای خصوصی من قفل هستند؟** روی دستگاهی که با کد وارد شده‌اید و کلید هنوز ذخیره نشده، روی نوار بالای فهرست بزنید و یک‌بار رمز عبور را بنویسید. **مشکلی را چطور گزارش کنم؟** به @support بنویسید. یکی از اعضای تیم پیکو در همان گفتگو پاسخ می‌دهد. # مستندات برنامه‌نویسان (فارسی) ## ربات پیکو چیست؟ ربات یک برنامه‌ی کوچک است که در پیکو مثل یک مخاطب عادی با آدم‌ها صحبت می‌کند. شما آن را با هر زبان برنامه‌نویسی می‌نویسید، هر جا خواستید اجرا می‌کنید و ربات از راه یک API ساده روی HTTPS با پیکو حرف می‌زند. Bot API پیکو همان شکل و قالب تلگرام را دارد؛ پس اگر قبلاً ربات تلگرام نوشته‌اید، بیشترش را از قبل بلدید. 🎉 🏠 کد کجا اجرا می‌شود؟ روی کامپیوتر خودتان، یک سرور، VPS یا تابع ابری. پیکو پیام‌ها را به برنامه‌ی شما می‌رساند و پاسخ آن را برمی‌گرداند. پیکو (فعلاً) کد شما را اجرا نمی‌کند. ## شروع سریع ربات را بسازید. در پیکو @botfather را باز کنید و /newbot را بفرستید. یک نام و یک نام کاربری که به bot ختم شود انتخاب کنید. توکن را کپی کنید. بات‌فادر توکنی شبیه 123456:AbCdEf-your-token می‌فرستد. برای کپی روی آن بزنید. هر وقت خواستید دوباره می‌توانید ببینیدش: /mybots ← ربات شما ← 🔑 توکن API. به رباتتان سلام کنید. آن را باز کنید و Start را بزنید. ربات‌ها هرگز نمی‌توانند به کسی که اول به آن‌ها پیام نداده، پیام بدهند. یک برنامه اجرا کنید. یکی از مثال‌های زیر را بردارید، توکن را بگذارید و به رباتتان پیام بدهید. 🎈 curlPythonNode.jsPHPGo Copycurl "https://picogram.ir/bot123456:AbCdEf-your-token/getMe" curl -X POST "https://picogram.ir/bot123456:AbCdEf-your-token/sendMessage" \ -H "content-type: application/json" \ -d '{"chat_id": 42, "text": "Hello from my bot 👋"}' curl Copyimport requests TOKEN = "123456:AbCdEf-your-token" API = f"https://picogram.ir/bot{TOKEN}" offset = 0 while True: r = requests.get(f"{API}/getUpdates", params={"offset": offset, "timeout": 30}, timeout=40).json() for u in r["result"]: offset = u["update_id"] + 1 m = u.get("message") if m and m.get("text"): requests.post(f"{API}/sendMessage", json={"chat_id": m["chat"]["id"], "text": f"You said: {m['text']}"}) Python Copyconst TOKEN = "123456:AbCdEf-your-token"; const API = `https://picogram.ir/bot${TOKEN}`; let offset = 0; for (;;) { const r = await (await fetch(`${API}/getUpdates?offset=${offset}&timeout=30`)).json(); for (const u of r.result) { offset = u.update_id + 1; const m = u.message; if (m?.text) { await fetch(`${API}/sendMessage`, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ chat_id: m.chat.id, text: `You said: ${m.text}` }), }); } } } Node.js Copy $m["chat"]["id"], "text" => "You said: " . $m["text"], ])); } } } PHP Copypackage main import ( "encoding/json" "fmt" "net/http" "net/url" "strings" ) const api = "https://picogram.ir/bot123456:AbCdEf-your-token" func main() { offset := 0 for { resp, err := http.Get(fmt.Sprintf("%s/getUpdates?offset=%d&timeout=30", api, offset)) if err != nil { continue } var out struct { Result []struct { UpdateID int `json:"update_id"` Message *struct { Text string `json:"text"` Chat struct{ ID int `json:"id"` } `json:"chat"` } `json:"message"` } `json:"result"` } json.NewDecoder(resp.Body).Decode(&out) resp.Body.Close() for _, u := range out.Result { offset = u.UpdateID + 1 if u.Message != nil && u.Message.Text != "" { http.PostForm(api+"/sendMessage", url.Values{ "chat_id": {fmt.Sprint(u.Message.Chat.ID)}, "text": {"You said: " + strings.TrimSpace(u.Message.Text)}}) } } } } Go 🔑 توکن مثل رمز عبور است. هرگز آن را در مخزن عمومی یا صفحه‌ی وب نگذارید. ## چطور وصل شویم همه‌ی درخواست‌ها به این نشانی می‌روند: Copyhttps://picogram.ir/bot/ URL 🔒 فقط HTTPS. 📨 پارامترها را به‌صورت query string، بدنه‌ی JSON (content-type: application/json) یا هر دو بفرستید. هم GET و هم POST کار می‌کند. 📦 پاسخ همیشه JSON است: در حالت موفق {"ok": true, "result": …} و در حالت خطا {"ok": false, "error_code": 400, "description": "…"}. 🐢 سقف درخواست: ۶۰۰ درخواست در دقیقه برای هر آدرس IP. کتابخانه‌های تلگرام بیشتر کتابخانه‌های ربات تلگرام اجازه می‌دهند آدرس API را عوض کنید. آن‌ها را به پیکو وصل کنید تا برای همه‌ی متدهای این صفحه کار کنند. متدهایی که پیکو هنوز ندارد خطا برمی‌گردانند. Copy# python-telegram-bot Application.builder().token(TOKEN).base_url("https://picogram.ir/bot").build() # aiogram 3 AiohttpSession(api=TelegramAPIServer.from_base("https://picogram.ir")) # grammY new Bot(TOKEN, { client: { apiRoot: "https://picogram.ir" } }) # Telegraf new Telegraf(TOKEN, { telegram: { apiRoot: "https://picogram.ir" } }) # node-telegram-bot-api new TelegramBot(TOKEN, { polling: true, baseApiUrl: "https://picogram.ir" }) Libraries ## زبان‌ها و قالب‌ها برای پیکو فرقی ندارد ربات را با چه زبانی بنویسید. اگر زبان شما بتواند درخواست HTTPS بفرستد و JSON بخواند، کار می‌کند: پایتون، جاوااسکریپت / تایپ‌اسکریپت (Node، Deno، Bun)، PHP، Go، جاوا، کاتلین، C#، Rust، روبی، دارت، سوئیفت، اسکریپت شل… 🌍 | پذیرفته می‌شود | 📡 انتقال | HTTPS (‏TLS 1.2 به بالا) | 📝 درخواست | query string، بدنه‌ی JSON (application/json) یا هر دو | 📤 پاسخ | JSON با UTF-8 | 🔤 متن | UTF-8، ۱ تا ۴۰۹۶ نویسه در هر پیام | 🔁 دریافت پیام | long polling با getUpdates یا وب‌هوک | ## متدها متد | پارامترها | کار | getMe | — | شناسه، نام و نام کاربری ربات شما. | getUpdates | offset، timeout (۰ تا ۵۰ ثانیه)، limit (۱ تا ۱۰۰) | long polling. با offset = آخرین update_id + 1 اعلام کنید کدام‌ها را انجام داده‌اید. | sendMessage | chat_id، text، parse_mode، reply_to_message_id، reply_markup | ارسال پیام متنی. | editMessageText | chat_id، message_id، text، parse_mode، reply_markup | ویرایش پیامی که ربات فرستاده. | deleteMessage | chat_id، message_id | حذف پیامی که ربات فرستاده. | answerCallbackQuery | callback_query_id | به پیکو می‌گوید ضربه‌ی دکمه را انجام داده‌اید. | sendChatAction | chat_id، action | برای اینکه کدهای موجود کار کنند پذیرفته می‌شود. | setMyCommands / getMyCommands | commands: فهرست JSON از {command, description} (تا ۱۰۰ مورد) | منوی دستورهای ربات. دستورها حروف کوچک انگلیسی، عدد و آندرلاین‌اند. | getChat | chat_id | اطلاعات پایه‌ی یک گفتگو. | setWebhook / deleteWebhook / getWebhookInfo | url، secret_token | دریافت به‌روزرسانی با وب‌هوک به‌جای polling. | 🧭 chat_id همان عددی است که در message.chat.id هر به‌روزرسانی می‌بینید. ## عکس، ویدئو و فایل ربات شما می‌تواند هر چیزی را که آدم‌ها در پیکو می‌فرستند بفرستد و دریافت هم بکند. متد | پارامتر فایل | نمایش | sendPhoto | photo | عکس | sendVideo | video | ویدئوی قابل پخش داخل گفتگو | sendAnimation | animation | ویدئوی تکرارشونده یا GIF | sendAudio | audio | فایل صوتی | sendVoice | voice | پیام صوتی با شکل موج | sendDocument | document | هر فایل دیگر | sendLocation، sendContact، sendDice | — | پیوند نقشه، کارت مخاطب، تاس‌انداختن 🎲 | همه‌ی این‌ها chat_id، caption (تا ۱۰۲۴ نویسه)، parse_mode، reply_to_message_id و reply_markup را هم می‌گیرند. برای ویدئو و صدا می‌توانید duration، width و height هم بدهید. خود فایل را سه‌ جور می‌توان داد: Copy# 1) upload a file from your computer (multipart/form-data) curl -F chat_id=42 -F caption="Look 👀" -F photo=@cat.jpg "https://picogram.ir/bot123456:AbCdEf-your-token/sendPhoto" # 2) send a file Pico already has (a file_id from an update or an earlier message) curl "https://picogram.ir/bot123456:AbCdEf-your-token/sendDocument" -d chat_id=42 -d document= # 3) let Pico download a public https link for you curl "https://picogram.ir/bot123456:AbCdEf-your-token/sendVideo" -d chat_id=42 --data-urlencode "video=https://example.com/clip.mp4" # receive: getFile gives a path, then download it curl "https://picogram.ir/bot123456:AbCdEf-your-token/getFile?file_id=" curl -O "https://picogram.ir/file/bot123456:AbCdEf-your-token/files/" curl 📤 آپلود با multipart/form-data (در هر درخواست یک فایل). 🆔 یک file_id که پیکو به شما داده، برای فرستادن دوباره‌ی همان فایل بدون آپلود. 🔗 یک لینک https عمومی: پیکو خودش آن را دانلود می‌کند (تا ۵۰ مگابایت، فقط آدرس‌های عمومی). دریافت فایل وقتی کسی عکس، ویدئو، پیام صوتی یا فایلی برای ربات شما می‌فرستد، به‌روزرسانی فیلد متناظر (photo، video، voice، document)، یک file_id و caption را دارد. Copy{ "update_id": 120, "message": { "message_id": 940, "from": { "id": 7, "is_bot": false, "first_name": "Sara" }, "chat": { "id": 42, "type": "private" }, "caption": "my cat", "photo": [ { "file_id": "k2s9…", "width": 1280, "height": 960, "file_size": 183412 } ] } } JSON getFile را صدا بزنید تا یک file_path بگیرید، بعد https://picogram.ir/file/bot/ را دانلود کنید. بزرگ‌ترین فایل ۲۰۰ مگابایت است (۵۰ مگابایت برای آپلود و لینک از سمت ربات). فوروارد، کپی و ویرایش forwardMessage و copyMessage (‏chat_id، from_chat_id، message_id)، editMessageCaption، editMessageReplyMarkup، pinChatMessage و unpinChatMessage. ## گروه، کانال و متدهای مدیریتی ربات خود را به یک گروه یا کانال اضافه کنید، با دسترسی‌های لازم ادمینش کنید تا بتواند گفتگو را مدیریت کند. متد | دسترسی لازم | کار | getChatMember | — | وضعیت یک نفر: creator، administrator، member، left یا kicked همراه دسترسی‌هایش. | getChatAdministrators | — | مالک و همه‌ی ادمین‌ها. | getChatMemberCount | — | تعداد اعضا. | banChatMember / unbanChatMember | ban | حذف و مسدودکردن بازگشت یک نفر، یا اجازه‌ی برگشتش. | setChatTitle / setChatDescription | info | تغییر نام یا توضیح. | pinChatMessage / unpinChatMessage | pin | سنجاق‌کردن یا برداشتن سنجاق پیام. | leaveChat | — | ربات خارج می‌شود. | promoteChatMember | admins | کسی را با can_change_info، can_post_messages، can_edit_messages، can_delete_messages، can_restrict_members، can_invite_users، can_pin_messages و can_promote_members ادمین می‌کند (هرگز بیشتر از دسترسی‌های خود ربات). | setChatPermissions | ban | تعیین اینکه اعضای عادی گروه چه کارهایی بکنند. | exportChatInviteLink / createChatInviteLink / revokeChatInviteLink | invite | گرفتن یا بازنشانی پیوند دعوت. | setChatPhoto / deleteChatPhoto | info | تغییر تصویر. | unpinAllChatMessages | pin | برداشتن همه‌ی سنجاق‌ها. | deleteMessages، forwardMessages، copyMessages، sendMediaGroup | — | چند پیام یکجا؛ آلبوم تا ۱۰ عکس، ویدئو، فایل صوتی یا سند. | دسترسی‌های ادمین مالک و ادمین‌ها دقیقاً همان دسترسی‌هایی را که لازم است به افراد (و ربات‌ها) می‌دهند: تغییر اطلاعات، ارسال پیام (کانال)، ویرایش و حذف پیام، مسدودکردن افراد، دعوت افراد، سنجاق‌کردن پیام و افزودن ادمین جدید. مالک همچنین می‌تواند گفتگو را به شخص دیگری واگذار کند و تعیین کند اعضای عادی یک گروه چه کارهایی بتوانند بکنند (ارسال پیام، ارسال رسانه، افزودن افراد، سنجاق و تغییر اطلاعات). نمایه‌ی ربات شما setMyName، getMyName، setMyDescription، getMyDescription. تصویر ربات را در @botfather عوض کنید: /mybots ← ربات شما ← 📷 ویرایش تصویر. پاسخ به دکمه‌ها answerCallbackQuery با text یک پیام کوتاه به کسی که روی دکمه زده نشان می‌دهد. به‌روزرسانی عضویت وقتی ربات شما به یک گروه یا کانال اضافه یا از آن حذف می‌شود، یک به‌روزرسانی my_chat_member با status قبلی و جدید (member، left یا kicked) می‌گیرد. ## به‌روزرسانی‌ها: ربات چه دریافت می‌کند هر مورد از getUpdates (یا هر فراخوانی وب‌هوک) یک update_id دارد و یکی از دو چیز را: 💬 یک پیام Copy{ "update_id": 118, "message": { "message_id": 931, "from": { "id": 7, "is_bot": false, "first_name": "Sara", "username": "sara" }, "date": 1767225600, "text": "hello", "chat": { "id": 42, "type": "private" } } } JSON text متن ساده است. اگر کاربر قالب‌بندی کرده باشد، formatted_text هم متن اصلی را همراه نمادهای قالب‌بندی پیکو دارد. 👆 ضربه روی دکمه Copy{ "update_id": 119, "callback_query": { "id": "931.1767225700000", "from": { "id": 7, "is_bot": false, "first_name": "Sara", "username": "sara" }, "data": "yes", "message": { "message_id": 931, "chat": { "id": 42, "type": "private" }, "text": "Pick one" } } } JSON در گروه‌ها و کانال‌ها ربات فقط دستورها (/start)، پیام‌هایی که به آن اشاره دارند (@yourbot) و پاسخ به پیام‌های خودش را می‌بیند. ⏳ به‌روزرسانی‌هایی که تأیید نکنید ۲۴ ساعت نگه داشته می‌شوند. ## قالب‌بندی متن به sendMessage و editMessageText پارامتر parse_mode بدهید: HTML، MarkdownV2 یا Markdown، دقیقاً مثل تلگرام. بدون آن متن همان‌طور که نوشته‌اید فرستاده می‌شود. HTML Copybold italic underline strike spoiler link inline code
print("hi")
quote
HTML MarkdownV2 Copy*bold* _italic_ __underline__ ~strike~ ||spoiler|| [link](https://picogram.ir) `inline code` ```python print("hi") ``` >quote (escape these with a backslash: _ * [ ] ( ) ~ ` > # + - = | { } . !) MarkdownV2 پیکو پررنگ، کج، زیرخط، خط‌خورده، اسپویلر، کد درون‌خطی، بلوک کد با نام زبان، پیوند و نقل‌قول (حتی جمع‌شونده با
) را پشتیبانی می‌کند. اشاره (@name)، هشتگ، پیوند، ایمیل و /دستورها خودکار شناخته می‌شوند. اگر قالب‌بندی خراب باشد 400 can't parse entities می‌گیرید. ✨ کاربران هم می‌توانند پیام‌هایشان را قالب‌بندی کنند: متن را انتخاب کنند و دکمه‌ی T را بزنند، یا بنویسند **پررنگ** __کج__ ++زیرخط++ ~~خط‌خورده~~ ||اسپویلر||. ## دکمه‌ها (کیبورد درون‌خطی) به پیام reply_markup بدهید تا زیر آن دکمه نمایش داده شود. هر دکمه یا callback_data دارد (با ضربه روی آن، ربات یک callback_query می‌گیرد) یا url (یک پیوند را باز می‌کند). Copy{ "chat_id": 42, "text": "Pick one 👇", "reply_markup": { "inline_keyboard": [ [ { "text": "✅ Yes", "callback_data": "yes" }, { "text": "❌ No", "callback_data": "no" } ], [ { "text": "🌐 Website", "url": "https://example.com" } ] ] } } JSON محدودیت | مقدار | ردیف‌ها | تا ۸ | دکمه در هر ردیف | تا ۸ | متن دکمه | ۱ تا ۶۴ نویسه | callback_data | تا ۶۴ نویسه | url | فقط پیوندهای http(s) | 🎯 نکته‌ی طراحی: دو دکمه در هر ردیف روی گوشی زیباتر است. یک دکمه در ردیف را فقط برای برچسب‌های بلند استفاده کنید. وقتی کسی روی دکمه می‌زند، answerCallbackQuery را صدا بزنید و بعد با editMessageText پیام را به‌روز کنید یا پیام تازه بفرستید. کیبورد پاسخ جز دکمه‌های زیر پیام، reply_markup می‌تواند کلیدهایی را بالای فیلد پیام نشان دهد. ضربه روی یک کلید، متن آن را مثل پیام عادی می‌فرستد. Copy{ "keyboard": [[{"text":"یک"},{"text":"دو"}],[{"text":"انصراف"}]], "resize_keyboard": true, "one_time_keyboard": true, "input_field_placeholder": "انتخاب کنید…" } JSON one_time_keyboard: کلیدها بعد از یک ضربه پنهان می‌شوند (با دکمه‌ی کیبورد برمی‌گردند). {"remove_keyboard": true}: کلیدها را برمی‌دارد. {"force_reply": true}: فیلد پیام بلافاصله به پیام شما پاسخ می‌دهد. ## وب‌هوک به‌جای polling، پیکو می‌تواند هر وقت اتفاقی افتاد سرور شما را صدا بزند. Copycurl "https://picogram.ir/bot123456:AbCdEf-your-token/setWebhook" \ --data-urlencode "url=https://bot.example.com/pico-hook" \ --data-urlencode "secret_token=my_secret_123" curl 🔒 آدرس باید https روی پورت ۴۴۳ یا ۸۴۴۳ باشد و به یک آدرس عمومی برسد. 🔑 اگر secret_token بگذارید، هر فراخوانی هدر X-Pico-Bot-Api-Secret-Token را دارد. آن را بررسی کنید. 📮 پیکو به‌روزرسانی را به‌صورت JSON در یک POST می‌فرستد. ظرف ۱۰ ثانیه با 2xx جواب بدهید. 🔁 ارسال ناموفق ۳ بار تلاش می‌شود (همین حالا، بعد از ۱٫۵ ثانیه، بعد از ۸ ثانیه). getWebhookInfo آخرین خطا را نشان می‌دهد. ⚠️ تا وقتی وب‌هوک تنظیم است، getUpdates خطای 409 Conflict می‌دهد. برای برگشت به polling، deleteWebhook را صدا بزنید. ## قوانین و محدودیت‌ها موضوع | قانون | نام کاربری | به bot ختم شود، ۴ تا ۳۲ حرف انگلیسی، عدد یا آندرلاین، با حرف شروع شود. نام‌هایی که pico دارند فقط برای تیم پیکو هستند. | شروع گفتگو | ربات فقط به کسانی می‌تواند پیام بدهد که اول به آن پیام داده‌اند. | گروه و کانال | ربات دستورها، اشاره‌ها و پاسخ به خودش را می‌بیند. | رمزنگاری | گفتگو با ربات‌ها، گروه‌ها و کانال‌ها گفتگوی خصوصی حساب نمی‌شوند: هنگام انتقال و ذخیره محافظت می‌شوند. گفتگوی خصوصی بین دو نفر با کلیدهای وابسته به حساب‌هایشان رمزنگاری می‌شود. | اندازه‌ی پیام | ۱ تا ۴۰۹۶ نویسه. | نرخ درخواست | ۶۰۰ درخواست در دقیقه برای هر IP. | نگهداری به‌روزرسانی‌ها | ۲۴ ساعت. | 🚧 هنوز موجود نیست حالت inline (‏answerInlineQuery)، پرداخت، بازی، نظرسنجی، استیکر، sendVideoNote، دستورها به تفکیک زبان یا حوزه، و مینی‌اپ. نیازتان را از طریق @support در پیکو بگویید. 💙 ## خطاها کد | معنا | چه کنیم | 401 | Unauthorized | توکن اشتباه است یا باطل شده. در بات‌فادر بررسی کنید. | 400 | Bad Request | پارامتری ناقص یا نامعتبر است یا قالب‌بندی خوانده نشد. description را بخوانید. | 403 | Forbidden | ربات در آن گفتگو نیست یا شخص اول به ربات پیام نداده. | 404 | Not Found | این متد وجود ندارد (هنوز). | 409 | Conflict | وب‌هوک تنظیم است. deleteWebhook را بزنید یا از وب‌هوک استفاده کنید. | 429/5xx | کندتر / مشکل سرور | کمی صبر کنید و دوباره تلاش کنید. |