From cc3d2887d76374b87e17cb54981d4f9db0b97acc Mon Sep 17 00:00:00 2001 From: Hardikkr Date: Sat, 10 Apr 2021 15:26:40 +0530 Subject: [PATCH] Docs & Readme updated --- docs.md | 32 +++++++++++++++++++++++++++++--- readme.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/docs.md b/docs.md index 688324a..d550a2f 100644 --- a/docs.md +++ b/docs.md @@ -7,6 +7,32 @@ Event is a piece of code that is triggered when the bot detects something has ha Command is a piece of coed which is triggered when a user tells the bot to trigger -## Another way of getting bot's information -> print("{0.user}".format(Husky)) -> print("{0.user.avatar_url}".format(Husky)) +## 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](https://discord.com/developers/applications) - [GUIDE](https://discordpy.readthedocs.io/en/latest/intents.html?highlight=intents) + + +## For commands starting with a number +``` +@Husky.commands(aliases=["4to5"]) +async def _4to5(ctx): + ... +``` + + +## References +Documentation: [discordpy.readthedocs.io](https://discordpy.readthedocs.io/en/stable/)
+Youtube: [youtube.com/playlist](https://www.youtube.com/playlist?list=PLW3GfRiBCHOhfVoiDZpSz8SM_HybXRPzZ)
+Colors codes for embeds: [gist.github.com/thomasbnt/...](https://gist.github.com/thomasbnt/b6f455e2c7d743b796917fa3c205f812)
+Access google sheets in python using Gspread: [codingpub.dev/access-google-sheets-in-python-using-gspread](https://codingpub.dev/access-google-sheets-in-python-using-gspread)
diff --git a/readme.md b/readme.md index 6b82ab8..1476eb2 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,32 @@ ![](assets/husky_banner.png) + +## What Husky does? +Husky basic work is to take user's information and adds it in a Google Sheets.
+Other than this, it can also take some administrator actions. + +## Commands +>Prefix: ! +1. !husky +2. !register +3. !clear +4. !kick +5. !ban + +## Features +1. Provide detailed info how to use commands +2. Register users into our database +3. Gives role to newly registered users +4. Verify if user is already registered +5. Notify when a user joins the server +6. Notify when a user leave the server +7. Can clear a given number of messages (default: 2) +8. Can kick a user +9. Can ban a user + +## Technologies Used +1. Google Cloud Platform +2. Google Sheets API +3. Discord Developer Portal +4. Python +5. gspread +6. discord