Telegram Bot for Admins

Type: Service

How to create Bot and get API key:
  1. Create a Bot:
    • Open the Telegram app and search for the BotFather (@BotFather).
    • Start a chat with BotFather by clicking on the "Start" button.
    • Use the /newbot command to create a new bot. You will be prompted to choose a name and a username for your bot. The username must end with "bot" (e.g., MyBot or MyCoolBot).
  2. Get the API Key:
    • Once the bot is created, BotFather will provide you with a unique API key (also known as a token). This token is needed to authenticate your bot with the Telegram API.
  3. Set Up the Bot:
    • You can customize your bot's profile (e.g., set a profile picture, description, and about text) using commands like /setuserpic, /setdescription, and /setabouttext.
  4. Use the API Key:
    • To start using your bot, you'll need the API key provided by BotFather. Keep this key secure, as it allows full access to your bot's account.
That's it! You now have a bot on Telegram with an API key to start use bot functionality.

How to get UserID to access:
  • Open Telegram and search for the userinfobot (@userinfobot).
  • Start a chat with the bot by clicking on the "Start" button.
  • The bot will automatically respond with your User ID and some other basic information.
Config: config/telegram_bot.properties
Code:
# Enable Telegram bot
TelegramBotEnabled = False
# Telegram API Key from @BotFather
TelegramBotApiKey =
# API base URL
TelegramBotBaseURL = https://api.telegram.org/bot
# Telegram UserID for access to bot.
# Example TelegramChatIds = 123123,123124 or TelegramChatIds = 123123
TelegramChatIds =
# Telegram task delay (at milliseconds). By default 1 sec.
TelegramBotTaskDelay = 1000

Command List:
Code:
/help - Get list of available commands
/list_online - Show list of online players
/online - Show online player count
/find <name> - Find character by name
/whois <name> - Get info by player name
/inventory <playerName> - Show player inventory
/setlevel <name> <level> - Set player level
/give_item <name> <id> <count> - Give item to player
/remove_item <name> <id> <count> - Remove item from player
/pm <player> <message> - Send private message to player
/gmlist - Show list of GMs online
/announce <message> - Send an announcement to all players
/jail <name> <time> <reason> - Jail a player
/unjail <name> - Release a player from jail
/kick <name> - Kick player from the game
/char_ban <name> <days> - Ban a player
/chat_ban <name> <period> - Ban a player from chat
/nospam <name> <period> - Shadow ban a player's chat
/list_clans - Show list of all clans
/status - Show server status and info
/heap - Dump server heap memory
/mem - Show server memory usage
/gc - Show garbage collection info
/net - Show network statistics
/aistats - Show AI statistics
/effectstats - Show effects statistics
/threads - Show thread info and statistics
/config - Set or get configuration parameters
/pathfind - Show pathfinding statistics
/pool - Show thread pool statistics
/restart - Restart the server
/shutdown <time> - Shutdown the server
/abort - Abort server restart or shutdown
/uptime - Show server uptime
/version - Show server version

If you need any other commands or additions. Let me know and I will add if it is appropriate and useful.

How its look visual
3dc0deca536072dbb99bea4e3c7bbc90.png
 
Last edited:
Back
Top