diff --git a/.gitignore b/.gitignore index b083628..65c12bf 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,5 @@ dmypy.json # vscode settings .vscode/settings.json +# .py files used for testing +*.py \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore index 696758e..b76278c 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -3,3 +3,6 @@ .gitignore .gitattributes vsc-extension-quickstart.md +*.py +*.vsix +examples/** \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 83ff6ad..1752613 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,18 @@ All notable changes to the "discord-py-snippets" extension will be documented in - Fix some bugs -### [1.1.0] +## [1.1.0] -Add 3 new snippets, `!gbchk`, `cgchk` & `!embedhelp` -Add more info in the readme file +- Add 3 new snippets, `!gbchk`, `cgchk` & `!embedhelp` +- Add more info in the readme file + +## [1.2.0] + +- Add not shadowing command snippets (for function names for commands that are already defined eg. eval) +- Add embed snippets + - embed + - field + - footer + - author + - image + - thumbnail diff --git a/README.md b/README.md index 83cf4ad..e66ea12 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,9 @@ This extension contributes the following settings: * `myExtension.enable`: enable/disable this extension * `myExtension.thing`: set to `blah` to do something --> -## All snippets +## All Snippets + +### Normal Snippets | Name | Prefix | Description | |---------------------------------------------|--------------|---------------------------------------------------------------------------------------------------------------------| @@ -51,7 +53,20 @@ This extension contributes the following settings: | aiohttp Template | `!ahtp` | A basic aiohttp web request template (You need to have bot.session defined as a instance of aiohttp.ClientSession) | | Global Check Template | `gbchk` | A basic global check template | | Cog Check Template | `!cgchk` | A basic cog check template | -| Embed Help | `!embedhelp` | A custom help command implementation that modifies the default help and uses embed | +| Embed Help | `!embedhelp` | A custom help command implementation that modifies the default help and uses embed | +| Not Shadowing Command Template | `!unscmd` | A basic command template that doesn't shadow another function (Not for cogs) | +| Cog Not Shadowing Command Template | `!cgunscmd` | A basic command template that doesn't shadow another function for cogs | + +### Embed Snippets + +| Name | Prefix | Description | +|---------------------------------------------|--------------|------------------------------| +| Embed Template | `!emb` | Makes a Embed | +| Embed Field Template | `!embfield` | Adds a field to a embed | +| Embed Footer Template | `!embfoot` | Adds a footer to a embed | +| Embed Author Template | `!embauthor` | Adds a author to a embed | +| Embed Thumbnail Template | `!embthumb` | Adds a image to a embed | +| Embed Image Template | `!embimg` | Adds a thumbnail to a embed | ## Tips and Tricks @@ -62,6 +77,11 @@ This extension contributes the following settings: There isn't many snippets so any suggestions for snippets would be appreciated +## Contribute + +You can open a pull request anytime and I will look into it
+I suggest seeing the [vscode snippets documentation](https://code.visualstudio.com/docs/editor/userdefinedsnippets) before you open a pull request + ## Release Notes ### 1.0.0 @@ -74,12 +94,23 @@ Fix some bugs ### 1.1.0 -Add 3 new snippets, `!gbchk`, `cgchk` & `!embedhelp` +Add 3 new snippets, `!gbchk`, `cgchk` & `!embedhelp`
Add more info in the readme file +### [1.2.0] + +- Add not shadowing command snippets (for function names for commands that are already defined) +- Add embed snippets + - embed + - field + - footer + - author + - image + - thumbnail + ### Extensions in the screenshots -- [Monokai](https://marketplace.visualstudio.com/items?itemName=monokai.theme-monokai-pro-vscode) by [monokai](https://marketplace.visualstudio.com/publishers/monokai) +- [Monokai Pro](https://marketplace.visualstudio.com/items?itemName=monokai.theme-monokai-pro-vscode) by [monokai](https://marketplace.visualstudio.com/publishers/monokai) - [Bracket Pair Colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer) by [CoenraadS](https://marketplace.visualstudio.com/publishers/CoenraadS) diff --git a/package.json b/package.json index 195e106..80c8d93 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "discord-py-snippets", "displayName": "discord.py Code Snippets", "description": "Some code snippets for the discord.py package in python", - "version": "1.1.0", + "version": "1.2.0", "publisher": "WasiMaster", "repository": { "type": "git", diff --git a/snippets/snippets.code-snippets b/snippets/snippets.code-snippets index e1e5dea..8659190 100644 --- a/snippets/snippets.code-snippets +++ b/snippets/snippets.code-snippets @@ -26,6 +26,15 @@ ], "description": "A basic command template (Not for cogs)" }, + "discord.py Not Shadowing Command Template":{ + "prefix": "!unscmd", + "body": [ + "@${1|bot,client|}.command(name=\"${2:test}\")", + "async def _${2:test}(ctx$3):", + " await ctx.send(\"$0\")" + ], + "description": "A basic command template that doesn't shadow another function (Not for cogs)" + }, "discord.py Basic Event Template":{ "prefix": "!evt", "body": [ @@ -39,11 +48,20 @@ "prefix": "!cgcmd", "body": [ "@commands.command()", - "async def ${1:test}(self, ctx):", + "async def ${1:test}(self, ctx$2):", " await ctx.send(\"$0\")" ], "description": "A basic command template for cogs" }, + "discord.py Cog Not Shadowing Command Template":{ + "prefix": "!cgunscmd", + "body": [ + "@commands.command(name=\"${2:test}\")", + "async def _${2:test}(self, ctx$3):", + " await ctx.send(\"$0\")" + ], + "description": "A basic command template that doesn't shadow another function for cogs" + }, "discord.py Cog Event Template":{ "prefix": "!cgevt", "body": [ @@ -113,5 +131,45 @@ " await destination.send(embed=embed)" ], "description": "A custom help command implementation that modifies the default help and uses embed" + }, + "discord.py Embed Template":{ + "prefix": "!emb", + "body": [ + "embed = discord.Embed(${1:title=\"$2\",} ${3:description=\"$4\",} ${5:color=$6,}, ${7:timestamp=$8,})" + ], + "description": "Makes a Embed" + }, + "discord.py Embed Field Template":{ + "prefix": "!embfield", + "body": [ + "${1:embed}.add_field(name=\"$2\", value=\"$3\", inline=${4|True,False|})" + ], + "description": "Adds a field to a embed" + }, + "discord.py Embed Footer Template":{ + "prefix": "!embfoot", + "body": [ + "${1:embed}.set_footer(text=\"$2\", ${3:icon_url=\"${4}\"})" + ], + "description": "Adds a footer to a embed" + }, + "discord.py Embed Author Template":{ + "prefix": "!embauthor", + "body": [ + "${1:embed}.set_author(name=\"$2\", ${3:url=\"${4}\",} ${5:icon_url=\"${6}\"})" + ], + "description": "Adds a author to a embed" + }, + "discord.py Embed Thumbnail Template":{ + "prefix": "!embthumb", + "body": [ + "${1:embed}.set_thumbnail(url=\"$2\")" + ] + }, + "discord.py Embed Image Template":{ + "prefix": "!embimg", + "body": [ + "${1:embed}.set_image(url=\"$2\")" + ] } }