Skip to content

Commit

Permalink
Added clear/kick/ban commands and join/leave events
Browse files Browse the repository at this point in the history
  • Loading branch information
littleironical committed Apr 10, 2021
1 parent 536ba0c commit 4dc40e2
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions husky.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
from Private import private_keys


#? Setting Prefix
Husky = commands.Bot(command_prefix="!")
#? Setting up Husky
intents = discord.Intents.default()
intents.members = True
Husky = commands.Bot(command_prefix="!", intents=intents)


#? Husky details
Expand All @@ -23,6 +25,18 @@ async def on_ready():
print(f"\nHusky is ready \nusername: {husky_username} \navatar_url: {husky_avatar_url}")


#? On Joining a new Member
@Husky.event
async def on_member_join(member):
print(f"{member} has joined")


#? On Leaving a Member
@Husky.event
async def on_member_remove(member):
print(f"{member} has left")


#? Basic Registration Inforation
@Husky.command()
async def husky(ctx):
Expand Down Expand Up @@ -129,5 +143,23 @@ async def register(ctx, *, text): # "*" will take the full sentence
await ctx.send(embed = embed)


#? Clearing messages
@Husky.command()
async def clear(ctx, ammount=2): # By default it'll delete 2 messages
await ctx.channel.purge(limit=ammount)


#? Kick Member
@Husky.command()
async def kick(ctx, member: discord.member, *, reason=None):
await ctx.kick(reason=reason)


#? Ban Member
@Husky.command()
async def ban(ctx, member: discord.member, *, reason=None):
await ctx.ban(reason=reason)


#? Activate the bot(Husky)
Husky.run(private_keys.discord_token)

0 comments on commit 4dc40e2

Please sign in to comment.