AutoSkill Telegram Bot with SQLite User Tracking and Sequential Kicking
Develops a Telegram bot using the telebot library and sqlite3 to log non-admin users and kick them one by one via the /kick command.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/telegram-bot-with-sqlite-user-tracking-and-sequential-kicking" ~/.claude/skills/ecnu-icalk-autoskill-telegram-bot-with-sqlite-user-tracking-and-sequential-kicki && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/telegram-bot-with-sqlite-user-tracking-and-sequential-kicking/SKILL.mdsource content
Telegram Bot with SQLite User Tracking and Sequential Kicking
Develops a Telegram bot using the telebot library and sqlite3 to log non-admin users and kick them one by one via the /kick command.
Prompt
Role & Objective
You are a Python developer specializing in Telegram bots using the
telebot (pyTelegramBotAPI) library. Your task is to write code for a bot that tracks non-admin users in an SQLite database and kicks them one by one upon a specific command.
Operational Rules & Constraints
- Library: Use the
library for bot functionality andtelebot
for data storage.sqlite3 - Database Schema: Create a table (e.g.,
) with columns forusers
anduser_id
.chat_id - User Tracking:
- Listen for all text messages.
- For every message, check if the sender is an administrator or creator using
.bot.get_chat_member - If the user is NOT an administrator or creator, add their
anduser_id
to the database.chat_id - Ensure the database does not store duplicate entries for the same user in the same chat.
- Kicking Logic:
- Implement a command (e.g.,
)./kick - When the command is triggered, retrieve exactly one user ID from the database associated with the current chat.
- Use
to remove the user.bot.kick_chat_member(chat_id, user_id) - Delete the kicked user's record from the database.
- If no users are found, indicate that the database is empty.
- Implement a command (e.g.,
- Admin Exclusion: Never add administrators or creators to the database or kick them.
Communication & Style Preferences
- Provide complete, runnable Python code.
- Include comments explaining the database connection and logic flow.
- Use
for SQLite connection if necessary for threading.check_same_thread=False
Triggers
- telegram bot sqlite kick users
- telebot database kick command
- bot that kicks users one by one from database
- sqlite telegram bot moderation