Giter Club home page Giter Club logo

vscode-discord.py-snippets's Introduction

What is discord-py-snippets

A simple snippets extension for the discord.py package for python

VS Code Marketplace Downloads VS Code Marketplace Installs VS Code Marketplace Rating

Features

Making a cog

Cog Example

Making a command

Command Example

Starter Template

Starter Example

Making a event

Event Example

Using the library aiohttp to use a api in a command

AioHTTP Example

All Snippets

Normal Snippets

Name Prefix Description
Starter Template !dpstrt A starter template
Basic Command Template !cmd A basic command template (Not for cogs)
Basic Event Template !evt A basic event template (Not for cogs)
Cog Command Template !cgcmd A basic command template for cogs
Cog Event Template !cgevt A basic event template for cogs
Cog Template !cog A starter template for a cog
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
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
Group Template !grp A group template (Can be used in cogs)
Group Command Template !grpcmd A basic group command template (Can be used in cogs)
Wait for reaction Template !waitforreaction A wait for template for on_reaction_add
Wait for message Template !waitformessage A wait for template for on_message
Discord based exception !except A basic exception template based on a discord error

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
Embed Page Reaction Template !embpagere Makes a embed with page navigation

Check Snippets

Name Prefix Description
Owner only check Template !owneronly Sets a command as owner_only
NSFW only check Template !nsfwonly Sets a command as nsfw only
Has Permissions check Template !hasperms makes a command require a permission
Guild Only check Template !guildonly makes a command require the user to be in a guld

UI

Name Prefix Description
Button !button A basic button
Custom Button !cbutton A button with a custom constructor
Select !select A basic select

Tips and Tricks

  • Use Tab to navigate between required inputs
  • Use Shift+Tab to edit the previous input
  • Once a input is focused on, press backspace and then press tab to skip it if you don't want to add that
  • Once a input is focused on, press tab to skip and keep the default value
  • If you don't want something, you can press backspace to remove it

Known Issues

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 before you open a pull request

Release Notes

1.0.0

  • Initial release of discord.py-snippets

1.0.1

  • Fixed some bugs

1.1.0

  • Added 3 new snippets, !gbchk, cgchk & !embedhelp\
  • Added more info in the readme file

1.2.0

  • Added not shadowing command snippets (for function names for commands that are already defined)
  • Added embed snippets
    • embed
    • field
    • footer
    • author
    • image
    • thumbnail

1.2.1

  • Fixed a issue in the !emb snippet where there were double commas

1.2.2

  • Fixed a issue in the !emb snippet where there was a : where there shouldn't be one

1.3.0

  • Added Group Template !grp
  • Added Group command Template !grpcmd
  • Made event names always start with on_
  • Made it easier to add commands with aliases
  • Changed the command in !dpstrt from test to hello
  • Made it easier to know what a value is for

1.3.1

  • Fixed a bug in !cgcmd where the aliases field would have a unnecessary comma

1.4.0

  • Changed the !cog snippet to use the current file name as the cog name, thanks to QuaKe
  • Added !owner_only check
  • Added !nsfw_only check
  • Added !hasperms check
  • Added !cooldown decorator
  • Added !waitforreaction snippet
  • Added !waitformessage snippet

1.5.0

  • Added UI Category with !button, !cbutton and !select
  • Added !except snippet
  • Fixed indendation in !embedhelp

1.5.1

  • Added a on_ready event in the !dpstrt snippet

1.5.1

  • Added a on_ready event in the !dpstrt snippet
  • Fix LICENSE year

1.5.2

  • Small fix

1.5.3

  • Fix !grpcmd snippet

1.5.4

  • Fix !grpcmd snippet

1.6.0

  • Add !embpagere snippet

1.7.0

  • Add !guildonly snippet
  • Fix !embpagere snippet

Extensions in the screenshots


Enjoy!

vscode-discord.py-snippets's People

Contributors

cyrus01337 avatar deepquantum avatar dittttfrs avatar imgbotapp avatar thefakequake avatar wasi-master avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vscode-discord.py-snippets's Issues

Snippets for defining Client, Bot and custom variants

I make a lot of bots, these would help if only ever so slightly. Using this issue as reference and will be dealing with in a separate PR.

Originally I considered making a new baseline for bots which is now in the works, until this is complete I'd love a snippet for these things in specifics.

May be good to include setting it up and suppressing KeyboardInterrupt, still considering.

Update snippets to conform to discord.py==2.1.0

I've noticed certain commonly used snippets like !cog will need to be updated so that the entry function and it's contents are async as per the new changes, there may also be other discrepancies in other snippets.

What is the stance on this? I'm more than happy to go through the snippets that I know at the moment and prepare a PR if needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.