Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.41 KB

docs.md

File metadata and controls

38 lines (28 loc) · 1.41 KB

What's the difference between event & command?

@Husky.event
Event is a piece of code that is triggered when the bot detects something has happened

@Husky.command()
Command is a piece of coed which is triggered when a user tells the bot to trigger

For assigning roles as soon as user joins

intents = discord.Intents.default()
intents.members = True

#? Setting Prefix
Husky = commands.Bot(command_prefix="!", intents=intents)

@Husky.event
async def on_member_join(member):
    role = discord.utils.get(member.guild.roles, name="MEMBER")
    await member.add_roles(role)

*You also have to enable privileged intents in the developer portal - GUIDE

For commands starting with a number

@Husky.commands(aliases=["4to5"])
async def _4to5(ctx):
    ...

References

Documentation: discordpy.readthedocs.io
Youtube: youtube.com/playlist
Colors codes for embeds: gist.github.com/thomasbnt/...
Access google sheets in python using Gspread: codingpub.dev/access-google-sheets-in-python-using-gspread