Telegraph Bot Usage Guide
Stark BotsContent List
- First Meetup
- What is Account Number?
- What is Short Name?
- What is Author Name?
- What is Author URL?
- What is Page Path?
- Creating Account
- Creating Pages
- Managing and Editing Accounts
- Editing Existing Pages
- Listing Pages and Accounts
- Getting Account Info
- Adding an Existing Account
- Removing Account
- Getting Views of a Page
- Uploading Images
- Example of HTML
- Allowed HTML
- Important HTML Tips
- Source Code
- Support and Community
First Meetup
When you will message the bot for the first time, it'll generate a new account for you. It is set as the default account and it's account number is considered zero.
What is Account Number?
Account number helps the bot identify the targeted account. You can see the account numbers by sending /accounts command. Account number starts with zero where zero is the default account, which is created automatically.
What is Short Name?
Every Telegraph account has a short name. It is not unique for each account, i.e, you can use same short name for multiple accounts. It can be anything, like your own name and can have multiple words, for example - Stark Bots. This helps users differentiate multiple accounts. Also, it is private and only shown to you.
What is Author Name?
Author Name is shown below telegraph page's title. It is visible to everyone.
What is Author URL?
Author URL is usually a link to Author's profile, but it can be any URL. It is opened when user clicks on author name below their page's title.
What is Page Path?
Page Path is the path to Telegraph Page. For example, path to https://telegra.ph/My-Page-01-01 is My-Page-01-01. It is needed to Edit Pages or to Get Page Views.
Creating Account
Creating Account is very easy. Just send /create ShortName or /new ShortName to create one. Example /create Stark Programmer.
Creating Pages
Creating Pages isn't hard either. You need three things. The account number, page title and HTML content. First send your HTML content as text message or HTML document. Then reply it with /page account_number page_title. Example /page 2 My Last Page
Managing and Editing Accounts
After creating a new account, you can also edit it's values. There are three things that are editable.
- /editshortname - To Edit Short Name
- /editauthorname - To Edit Author Name
- /editauthorurl - To Edit Author URL
Just pass the account number and value. Example /editauthorname 3 Sansa Stark
Editing Existing Pages
You can edit an existing page using the /editpage command. You need to pass the account number, page path and page title. Example /editpage 0 My-Other-Page-34-35 My Other Page Note that the previous title can be changed by passing different title in command, otherwise pass the previous one.
Listing Pages and Accounts
You can list your existing pages using /pages command and accounts using /accounts command. Make sure to pass the account number while using /pages command.
Getting Account Info
You can get full account info using /get account_number. For example: /get 1
Getting Views of a Page
You can get views of a particular page using /views command. You need to pass the page path. For example: /views My-Second-Page-02-21
Adding an Existing Account
You can add an already existing account using /add access_token. For example: /add abcdefghijklmnopqrstuvwxyz
Removing Account
You can remove unnecessary accounts from our database using /remove account_number, for example: /remove 3. Note that your account is not actually deleted. It is just removed from bot's database. Telegraph accounts cannot be deleted.
Uploading Images
You can upload images to Telegraph in two ways.
First one is, Direct Upload which will give you a direct link back to the single image.
Second one is Uploading as a Telegraph Page . This will generate a single Telegraph page of all the images. Set custom title using /title command. To set caption for images, send an image message with some caption. Bot will copy it and paste that below your image.
Example of HTML
You can get the HTML document of this Telegraph page from our Github Repository. It can serve as an example for you.
Allowed HTML
Available HTML Tags: a, aside, b, blockquote, br, code, em, figcaption, figure, h3, h4, hr, i, iframe, img, li, ol, p, pre, s, strong, u, ul, video
Available HTML Attributes: href, src
Important HTML Tips
Content List: Just create hyperlinks to the subsections using the same exact titles with "-" instead of space. It's case-sensitive so be careful.
Images: Use the <img> tag to embed images.
Videos: Use the <video> tag to embed videos.
Empty/New Line: Use the <br> tag to add empty line.
Source Code
Source Code for this bot can be found on our GitHub Repository.
Support
For any questions, feel free to ask questions on our support group
For more bots visit our Support Channel