We are going to make a command which gives a user strike and 3 strike = kick/ban
Md Shahriyar Alam
2 years ago
Lets make a /strike command which we can use to strike a member
and if the member gets more than 3 strikes the bot will kick him.
Pre
require_permission("administrator") # You can also use allowed_roles()
current_strikes = member_var("strikes", member=target.id, default=0)
new_strikes = number(current_strikes) + 1
remaining_strikes = 3 - new_strikes
update_member_var("strikes", new_strikes, member=target.id)
response = (
f"{target.mention} has been striked. Total strikes **{new_strikes}**\n"
f"If you get **{remaining_strikes}** more strikes you will get kicked from this server."
)
if new_strikes >= 3:
kick_member(target, message=f"You got {new_strikes} strikes and kiked from {server.name}")
response = f"{target} has been kicked from the server for getting 3 strikes"Content
{response}Now you can run this command and give strike to member
/strike @Shahriyar
Loading comments…
Have a question, a suggestion, or stuck on something? Reach out — we're happy to help.