Skip to content

Commit

Permalink
1.2.0
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
wasi-master committed Nov 2, 2020
1 parent 94c7c21 commit 2022e00
Show file tree
Hide file tree
Showing 6 changed files with 114 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,5 @@ dmypy.json
# vscode settings
.vscode/settings.json

# .py files used for testing
*.py
3 changes: 3 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
.gitignore
.gitattributes
vsc-extension-quickstart.md
*.py
*.vsix
examples/**
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 35 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
|---------------------------------------------|--------------|---------------------------------------------------------------------------------------------------------------------|
Expand All @@ -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

Expand All @@ -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 <br>
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
Expand All @@ -74,12 +94,23 @@ Fix some bugs

### 1.1.0

Add 3 new snippets, `!gbchk`, `cgchk` & `!embedhelp`
Add 3 new snippets, `!gbchk`, `cgchk` & `!embedhelp` <br>
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)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
60 changes: 59 additions & 1 deletion snippets/snippets.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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": [
Expand Down Expand Up @@ -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\")"
]
}
}

0 comments on commit 2022e00

Please sign in to comment.