A template that help you getting started with Pycord.

Overview

A Pycord Template with some example!

Getting Started:

  1. Clone this repository using
git clone https://github.com/AungS8430/pycord-template.git
  1. If you have discord.py installed, please do pip uninstall discord.py first.
  2. You must have Python 3.8 or above installed ( I use Python 3.8.12).
  3. Do
pip install -r requirements.txt

to install requirements. 5. Go to .env.example, remove .example and insert your bot's token and welcome channel ID into the file. You must keep your bot's token private! 6. To run this basic bot, run

python 3.8 main.py

in the same directory as your bot.

Adding Commands or Events:

Add commands:

  1. Create a new Python file in /cogs/commands
  2. Add this code in the file
import discord
from discord.ext import commands, tasks
from discord.commands import slash_command, Option #, SlashCommandGroup if you want to create a category.
class CogName(commands.Cog): # Replace 'CogName' with your cog name.
    def __init__(self, bot):
        self.bot = bot
    category = SlashCommandGroup('Category name', 'Category description')
    @slash_command( #change it into @category.command( if you use category.
        name='command name here',
        description='commnad description here',
    )
    async def commandname(self, ctx, option: Option(str, 'This is option', required=True)):
        embed = discord.Embed(
            title='hello',
            description=f'{option}',
            color=discord.Color.green()
        )
        await ctx.respond(embed=embed)

def setup(bot):
    bot.add_cog(CogName(bot))
  1. Add the file directory into main.py in this format cogs.commands.filename

Add event:

  1. Create a new Python file in /cogs/events
  2. Add this code in the file
import discord
from discord.ext import commands, tasks

class CogName(commands.Cog): # Replace 'CogName' with your cog name.
    def __init__(self, bot):
        self.bot = bot
    @command.Cog.listener()
    async def eventname(self, ...):
        # do something
    
def setup(bot):
    bot.add_cog(CogName(bot))
  1. Add the file directory into main.py in this format cogs.event.filename
You might also like...
Discord.py-Bot-Template - Discord Bot Template with Python 3.x

Discord Bot Template with Python 3.x This is a template for creating a custom Di

Pincer-bot-template - A template for a Discord bot created using the Pincer library

Pincer Discord Bot Template (Python) WARNING: Pincer is still in its alpha/plann

Github repository started notify 💕
Github repository started notify 💕

Github repository started notify 💕

A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studying.

Studying RPC Description A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studyin

Assassination API for getting random quotes from Assassination Classroom.
Assassination API for getting random quotes from Assassination Classroom.

Assassination API Take advantage of what you have, while you have it. Quotes from Assassination Classroom Assassination classroom is one of best anime

A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster
A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster

tokeks A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster. No AWS CLI, third-party client or library (boto3, botoc

🔪 Block replies to viral tweets from users getting paid to promote useless products
🔪 Block replies to viral tweets from users getting paid to promote useless products

This Tweet Took Off Ublock Origin filter list targeting long reply chains posted by twitter users who get paid to promote random products on viral twe

Demonstrate how GitHub OIDC token getting should be included in boto3

boto3 should add direct support for AssumeRoleWithWebIdentity for GitHub Actions There is a aws-actions/configure-aws-credentials action that will get

An API or getting Optifine VersionsList/Version/Download-URL.

Optifine-API An API for getting Optifine VersionsList/Versions/Download-URL. Table of contents Get Versions List Get Specify Versions Download Optifin

Owner
null
A course on getting started with the Twitter API v2 for academic research

Getting started with the Twitter API v2 for academic research Welcome to this '101 course' on getting started with academic research using the Twitter

@TwitterDev 426 Jan 4, 2023
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API

pycord A fork of discord.py. PyCord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Mo

Pycord Development 2.3k Dec 31, 2022
Robocord is a bot created for the Pycord community.

Robocord is a bot created for the community of the Pycord Server. Just a bot created for Pycord Server. You can start pull requests, I will check it and if its good I will add it to the bot. ??

Bruce 7 Jun 26, 2022
Maintained wavelink fork for pycord

Pycord.Wavelink Wavelink is robust and powerful Lavalink wrapper for Pycord! Wavelink features a fully asynchronous API that's intuitive and easy to u

Pycord Development 23 Dec 11, 2022
A Discord Bot created using Pycord!

Hey, I am Slash Bot. A Bot which works with Slash Commands! Prerequisites Python 3+ Check out. the requirements.txt and install all the pakages. Insta

Saumya Patel 1 Nov 29, 2021
A Slash Commands Discord Bot created using Pycord!

Hey, I am Slash Bot. A Bot which works with Slash Commands! Prerequisites Python 3+ Check out. the requirements.txt and install all the pakages. Insta

Saumya Patel 18 Nov 15, 2022
YuuScource - A Discord bot made with Pycord

Yuu A Discord bot made with Pycord Features Not much lol • Easy to use commands

kekda 9 Feb 17, 2022
null 5 Oct 19, 2022
You can share your Chegg account for answers using this bot with your friends without getting your account blocked/flagged

Chegg-Answer-Bot You can share your Chegg account for answers using this bot with your friends without getting your account blocked/flagged Reuirement

Ammey Saini 27 Dec 24, 2022
Written in Python, freezed into stand-alone executable with PyInstaller. This app will make sure you stay in New World without getting kicked for inactivity.

New World - AFK Written in Python, freezed into stand-alone executable with PyInstaller. This app will make sure you stay in New World without getting

Rodney 5 Oct 31, 2021