getMyCommands
Mengembalikan daftar perintah bot saat ini.
Nilai kembalian: Jika berhasil, mengembalikan Array of BotCommand.
Parameter
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
scope | BotCommandScope | Opsional | Objek JSON BotCommandScope |
language_code | String | Opsional | Kode bahasa (tag IETF) |
Contoh permintaan
curl
curl -s "https://api.telegram.org/bot$TOKEN/getMyCommands"
Python
import requests
TOKEN = "123456789:AAEexampleTokenReplaceWithYours"
resp = requests.get(f"https://api.telegram.org/bot{TOKEN}/getMyCommands", timeout=30)
print(resp.json())
JavaScript
const TOKEN = "123456789:AAEexampleTokenReplaceWithYours";
const res = await fetch(`https://api.telegram.org/bot${TOKEN}/getMyCommands`);
console.log(await res.json());
Panduan langkah demi langkah: Cara Membuat Bot Telegram: dari BotFather sampai Pesan Pertama
Metode terkait
getMeMengembalikan informasi bot.setMyCommandsMengatur daftar perintah bot.deleteMyCommandsMenghapus perintah bot.getMyNameMengembalikan nama bot.setMyNameMengatur nama bot.getMyDescriptionMengembalikan deskripsi bot.setMyDescriptionMengatur deskripsi bot.getMyShortDescriptionMengembalikan deskripsi singkat bot.setMyShortDescriptionMengatur deskripsi singkat bot.setMyProfilePhotoMengatur foto profil bot.removeMyProfilePhotoMenghapus foto profil bot.getUserProfilePhotosMengembalikan foto profil pengguna.