Lets make a strike command

Md Shahriyar Alam

a month 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.

Command

  • Name: strike
  • Description: Give strike to a member

Arguments

  • Name: target
  • Description: The target member to strike
  • Type: MEMBER

Hooks

Pre

pyrequire_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"

Response

Content

py{response}

Now you can run this command and give strike to member

/strike @Shahriyar

Need help?

If you still need any kind of help, have a suggestion for us or having a question in mind? Feel free to reach us out.

DiscordJoin support server
logoCustom Commands

#1 Custom commands discord bot available on the internet

stripe

Contact

20-22 Wenlock RoadEnglandN1 7GU

© WEiRDSOFT LTD. All rights reserved.