More Cogs

This commit is contained in:
= 2025-04-06 12:13:55 +07:00
parent 3accb31e42
commit d8771ca7ba
3 changed files with 23 additions and 21 deletions

21
commands/basic.py Normal file
View File

@ -0,0 +1,21 @@
import nextcord
from nextcord.ext import commands
class Main():
def __init__(self, bot):
self.client = bot
@commands.command()
async def help(self, ctx: nextcord.Message):
embed = nextcord.Embed(title="Help")
for command in self.client.commands:
embed.add_field(name=command.name, value=f"Arguments: {command.usage} \nDescription: {command.description}")
await ctx.reply(embed=embed)
@commands.command(description="Check how fast the bot will reply to you.")
async def ping(ctx: nextcord.Message):
await ctx.reply("Pong!")
def setup(bot):
Main(bot)

View File

@ -12,7 +12,7 @@ SquogVideo = {
'key': 'FFmpegExtractAudio',
'preferredcodec': 'mp3',
}],
"outtmpl": './%(uploader)s_%(title)s.%(ext)s',
"outtmpl": './music/%(uploader)s_%(title)s.%(ext)s',
"quality": "low"
}
@ -65,7 +65,7 @@ class Main(commands.Cog):
print(SquogExt)
SquogLength = SquogFinalName.find(SquogExt[1]) + 1
print(SquogLength)
SquogEvilFilename = f"{SquogFinalName[:SquogLength]}mp3"
SquogEvilFilename = f"music/{SquogFinalName[:SquogLength]}mp3"
SquogVoiceClient.play(nextcord.FFmpegPCMAudio(f"{SquogEvilFilename}"))
@commands.command(description="Stops the music in voice channel")

19
main.py
View File

@ -10,25 +10,6 @@ client.remove_command("help")
SquogMod = None
# _____ _
# / ____| | |
# | | ___ _ __ ___ _ __ ___ __ _ _ __ __| |___
# | | / _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` / __|
# | |___| (_) | | | | | | | | | | | (_| | | | | (_| \__ \
# \_____\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_|___/
@client.command()
async def help(ctx: nextcord.Message):
embed = nextcord.Embed(title="Help")
print(client.commands)
for command in client.commands:
embed.add_field(name=command.name, value=f"Arguments: {command.usage} \nDescription: {command.description}")
await ctx.reply(embed=embed)
@client.command(description="Check how fast the bot will reply to you.", help="evil")
async def ping(ctx: nextcord.Message):
await ctx.reply("Pong!")
for filename in os.listdir('./commands'):
if filename.endswith('.py'):
client.load_extension(f'commands.{filename[:-3]}')