Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pycord discord discordpy get total slash commands and total commands regestered in your bot

# i am using pycord
from discord.ext import commands
import discord

# creating the bot
bot = commands.bot("!", intents=discord.Intents.all())

# on ready event
@bot.event
async def on_ready()
	print("bot is ready")
	Print("Total commands: "+len(bot.commands))
	Print("Total slash commands: "+len(bot.application_commands))
    
# create a prefixed command
@bot.command()
async def test(ctx: commands.Context):
    await ctx.send("Success")

## create a slash command
@bot.slash_command()
async def slash(ctx: discord.ApplicationContext):
    await ctx.send(f"{ctx.author.mention} ran the command `{ctx.command}`")
Comment

PREVIOUS NEXT
Code Example
Python :: python tkinter ttk 
Python :: len(sys.argv) == 2 
Python :: swap in python 
Python :: python code for extracting data from pdf 
Python :: tensorflow metrics accuracy 
Python :: soup.find_all attr 
Python :: make a post request in python 
Python :: pandas create sample dataframe 
Python :: python for in for in 
Python :: virtual env pyhton 
Python :: python access each group 
Python :: how to plot box plot python 
Python :: Change Python interpreter in pycharm 
Python :: batch gradient descent 
Python :: lable on graph in matplotlib 
Python :: loginrequiredmixin django 
Python :: delete all messages discord.py 
Python :: split path in list of directories 
Python :: hex to string python 
Python :: keras 
Python :: scrapy selenium screnshot 
Python :: python turtle module 
Python :: how to use assert in python 
Python :: calculate mean of column pandas 
Python :: Username Promt using Python with Character Limit 
Python :: python datetime floor to hour 
Python :: eval function in python 
Python :: python obfuscator github 
Python :: split paragraphs in python 
Python :: can serializer returns an object in django 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =