-
Notifications
You must be signed in to change notification settings - Fork 3
Currently Supported Methods
Sauraj edited this page Oct 3, 2022
·
7 revisions
All these methods are defined in util.sh. If you think some methods are missing and you can add them, please go ahead and don't forget to open a pull request with the changes you made.
Commands listed below will only work when you have your
Bot token
stored in.token
file of current directory.
- Use this method to send text messages. On success, the sent Message is returned.
Example :
tg --sendmsg "<CHAT ID>" "<Text to Send>"
- Same as
--sendmsg
but works with Telegram Formatting options MarkdownV2 style.
Example :
tg --sendmarkdownv2msg "<CHAT ID>" "<Text to Send with markdown>"
- Use this method to edit a existing message sent by the bot.
Example :
tg --editmsg "<CHAT ID>" "<MESSAGE ID>" "<Text to edit current message>"
- Same as
--editmsg
but works with Telegram Formatting options MarkdownV2 style.
Example :
tg --editmarkdownv2msg "<CHAT ID>" "<MESSAGE ID OF MESSAGE>" "<Text with markdown to edit current message>"
- Use this method to reply a message.
Example :
tg --replymsg "<CHAT ID>" "<MESSAGE ID OF MESSAGE TO REPLY>" "<Text to Reply>"
- Use this method to reply a message with file.
Example :
tg --replyfile "<CHAT ID>" "<MESSAGE ID OF MESSAGE TO REPLY>" "<Path of file to Reply>"
- Use this method to reply a message but with
html
formatting.
Example :
tg --replymsghtml "<CHAT ID>" "<MESSAGE ID OF MESSAGE TO REPLY>" "<Text to Reply with HTML Formatting>"
- Same as
--replymsg
but works with Telegram Formatting options MarkdownV2 style.
Example :
tg --replymsgmarkdown "<CHAT ID>" "<MESSAGE ID OF MESSAGE TO REPLY>" "<Text to Reply with markdown Formatting>"
- Use this method to delete telegram message.
Example :
tg --delmsg "<CHAT ID>" "<MESSAGE ID OF MESSAGE TO DELETE>"
- Use this method to send sticker.
Example :
tg --sendsticker "<CHAT_ID>" "<FILE ID OF STICKER TO SEND"
- Use thid method to reply a message with sticker.
Example :
tg --replysticker "<CHAT ID>" "<MESSAGE ID OF MESSAGE TO REPLY>" "<FILE ID OF STICKER TO REPLY"
- Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.
Example :
tg --fwdmsg "<CHAT ID TO FORWARD FROM>" "<CHAT ID TO FORWARD FROM>" "MESSAGE OF MESSAGE TO FORWARD"
- Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.
Example :
tg --cpmsg "<CHAT ID TO FORWARD FROM>" "<CHAT ID TO FORWARD FROM>" "MESSAGE ID OF MESSAGE TO FORWARD"
- Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.
Example :
tg --pinmsg "<CHAT ID>" "MESSAGE ID OF MESSAGE TO PIN"
- Use this method to remove a message from the list of pinned messages in a chat.
Example :
tg --unpinmsg "<CHAT_ID>" "MESSAGE ID OF MESSAGE TO UNPIN"
- Use this method to get a list of profile pictures for a user.
Example :
tg --getuserpfp "<CHAT ID>" "<USER ID OF USER>"
- Use this method to download a file.
Example :
tg --downloadfile "<FILE ID>" "<OUTPUT FILE PATH WITH NAME AND EXTENSION>"
- Use this method to ban a user.
Example :
tg --ban "<CHAT ID>" "<USER ID OF USER TO BAN>"
- Use this method to unban a user.
Example :
tg --unban "<CHAT ID>" "<USER ID OF USER TO UNBAN>"
- Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format.
Example :
tg --sendaudiofile "<CHAT ID>" "<PATH OF AUDIO FILE>" "<CAPTION (Optional)"
- Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document).
Example :
tg --sendvoicefile "<CHAT ID>" "<PATH OF AUDIO FILE>" "<CAPTION (Optional)"