charmingdays / kurusaki_voice Goto Github PK
View Code? Open in Web Editor NEWsimple discord music bot
License: MIT License
simple discord music bot
License: MIT License
-----> 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
How i can setup the database? i tried to setup it it wont works
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)
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!
Playing music but I can't skip, see list, repeat anything
heroku tells me I have to be admin of the project to add it
KeyError: 'TOKEN'
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?
Is it working right now?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.