Code Monkey home page Code Monkey logo

kurusaki_voice's Introduction

This Repository Has Been Archived

Check out my latest bot Kurusaki for the latest version of Discord API and Lavalink

Heroku no longer includes a free tier version, so you will need to either get a free AWS tier to host your bot or run it on your own machine.

kurusaki_voice's People

Contributors

charmingdays avatar g5fighter avatar glitchii avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

kurusaki_voice's Issues

AttributeError: 'VoiceClient' object has no attribute 'ws'

Ignoring exception in on_message
Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.6/site-packages/discord/voice_client.py", line 344, in connect
await utils.sane_wait_for(futures, timeout=timeout)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/utils.py", line 352, in sane_wait_for
raise asyncio.TimeoutError()
concurrent.futures._base.TimeoutError
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 333, in _run_event
await coro(*args, **kwargs)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 943, in on_message
await self.process_commands(message)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 940, in process_commands
await self.invoke(ctx)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/bot.py", line 903, in invoke
await ctx.command.invoke(ctx)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 851, in invoke
 await self.prepare(ctx)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 791, in prepare
await self.call_before_hooks(ctx)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/ext/commands/core.py", line 732, in call_before_hooks
await self._before_invoke(instance, ctx)
File "/app/cogs/music.py", line 355, in before_play
return await msg.author.voice.channel.connect()
File "/app/.heroku/python/lib/python3.6/site-packages/discord/abc.py", line 1122, in connect
await voice.connect(timeout=timeout, reconnect=reconnect)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/voice_client.py", line 346, in connect
await self.disconnect(force=True)
File "/app/.heroku/python/lib/python3.6/site-packages/discord/voice_client.py", line 460, in disconnect
if self.ws:
AttributeError: 'VoiceClient' object has no attribute 'ws'

How do I fix this error?

Database

How i can setup the database? i tried to setup it it wont works

Can I use your code from music.py for my own bot?

I did not see a license hence I ask. I have been building a bot that plays background music, I would like to use your code in music.py, it is possible the bot may be profitable in case it works out. I am willing to credit ofc! Thanks for the amazing code though!

Remove the import

While deploying to heroku there is a problem of an unused import,ie., pymongo,which is needed to be removed for successful deploy.
Capture

runtime.txt

-----> Python app detected
-----> Using Python version specified in runtime.txt
! Requested runtime (python-3.8.2) is not available for this stack (heroku-20).
! Aborting. More info: https://devcenter.heroku.com/articles/python-support
! Push rejected, failed to compile Python app.
! Push failed

changing the python runtime to 3.9 or newer seems to fix this issue

[Request]: Include the option to download songs

It will be great if you add a command to download songs. I've made fro me a modification of the original script to have the possibility to do it.
Here is my code if it helps:

ytdl_download_format_options= {
    'format': 'bestaudio/best',
    'outtmpl': 'downloads/%(title)s.mp3',
    'reactrictfilenames': True,
    'noplaylist': True,
    'nocheckcertificate': True,
    'ignoreerrors': False,
    'logtostderr': False,
    'quiet': True,
    'no_warnings': True,
    'default_search': 'auto',
    'source_addreacs': '0.0.0.0',  # bind to ipv4 since ipv6 addreacses cause issues sometimes
    'output': r'youtube-dl',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '320',
}]
}

    @commands.command(name='download', brief='Download songs', description='[prefix]download <video url or title> Downloads the song')
    async def download(self,msg,*,song):
        try:
            with youtube_dl.YoutubeDL(ytdl_download_format_options) as ydl: 
                if "https://www.youtube.com/" in song:
                    download = ydl.extract_info(song, True)
                else:
                    infosearched = ydl.extract_info("ytsearch:"+song, False)   
                    download = ydl.extract_info(infosearched['entries'][0]['webpage_url'], True)
                filename = ydl.prepare_filename(download)
                await msg.send("Download is ready")
                await msg.send(file=discord.File(filename))
                await os.remove(filename)                    
        except:
            await msg.send("Song couldn't be downloaded: " + song)

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.