Raptor123471 / DingoLingo

A Discord music bot written in Python with support for Youtube, SoundCloud, Spotify, Bandcamp, Twitter, and custom files.
GNU General Public License v3.0
282 stars 165 forks source link

Bot doesn't respond to any command, and gives error. #123

Closed kaanalp28 closed 1 year ago

kaanalp28 commented 1 year ago

The bot doesn't respond to commands (e.g. the ones in musicbot.commands .general and .music) and gives the error when I run the run.py:

`2022-12-29 10:04:24 ERROR discord.ext.commands.bot Ignoring exception in command None discord.ext.commands.errors.CommandNotFound: Command "play" is not found

2022-12-29 10:04:32 ERROR discord.ext.commands.bot Ignoring exception in command None discord.ext.commands.errors.CommandNotFound: Command "skip" is not found `

image
solaluset commented 1 year ago

Library version mismatch may've caused this. Try downgrading py-cord to version 1.7.3. Alternatively, you can try my fork which is more up-to-date.

kaanalp28 commented 1 year ago

Thank you so much! I finally got it to work. I'm new to this whole coding thing, can you tell me if there's a way to add new commands (mostly misc. ones) and get them to work with this music bot as one? Or if I need to make a new cog, can you tell me how to make one? Thank you!

DerP4si commented 1 year ago

You can add new commands in BotFolder.musicbot.commands.music (or general) by using @bridge.bridge_command( name="commandName", description="description but not a must have", help="not a must have", aliases=["this_works_too"], ) async def _comandfunction(self, ctx: Context,): your code

or you make a new file BotFolder.musicbot.commands.test

import discord

from config import config from discord.ext import commands, bridge from musicbot import linkutils, utils from musicbot.bot import MusicBot, Context

class Test(commands.Cog):

def __init__(self, bot: MusicBot): self.bot = bot

# logic is split to uconnect() for wide usage

@bridge.bridge_command( name="commandName", description="description but not a must have", help="not a must have", aliases=["this_works_too"], ) async def _comandfunction(self, ctx: Context,): your code

def setup(bot: MusicBot): bot.add_cog(Test(bot))

and add

"musicbot.commands.test",

to initial_extensions in run.py

try to do the second approach so you can easily go back to the default untouched bot by just commenting out the "musicbot.commands.test", line ^^

*edit: this applies only to the DandelionMusic fork

solaluset commented 1 year ago

Thank you so much! I finally got it to work. I'm new to this whole coding thing, can you tell me if there's a way to add new commands (mostly misc. ones)...

You're welcome. To make new commands you can inspect existing ones and create something similar. There are plenty of guides/examples online, like the one above. If you think that these commands are useful to have in the bot, you can share your ideas by submitting an issue to my fork.

kaanalp28 commented 1 year ago

Thank you! I will get to work and make a bot with my friends to enjoy (and troll) with them! Thank you for your super-fast responses, I didn't expect it to be this fast tbh, but it's truly awesome. I'll make sure I send my ideas to you too, see you later! :)