Giter VIP home page Giter VIP logo

discord-bot's Introduction

Discord Bot that plays music! python

I decided to create a simple Discord bot using Python and the Discord.py API.

DO NOT COPY AND PASTE THIS CODE IF YOU DO NOT KNOW WHAT YOU ARE DOING.

This bot as of right now can:

  • Join the channel you're in
  • Play from Youtube
  • Pause
  • Stop
  • Resume
  • Clear messages in channel

To do:

  • Add messages when commands are executed succesfully โœ”
  • Queue system
  • Have the bot always on (I would have to pay for this option so it's really not worth it as of right now)
  • Include eventual jokes
  • use cogs to organize commands

Dependecies:

INSTALL THESE DEPENDECIES IN ORDER FOR THE CODE TO WORK

  • discord.py
  • ffmpeg
  • YouTube-dl
  • dotenv

discord-bot's People

Contributors

eric-yeung 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

Watchers

 avatar  avatar  avatar  avatar

discord-bot's Issues

Issues

Confirmation message not sending when .play command is run

.env file

Recommend adding an example vanilla .env file for consumption.

AttributeError: 'NoneType' object has no attribute 'is_playing'

I've been balding my head for 5 hours wondering why this happen. anyone care to explain? I did installed all dependencies. Apologies in advance

`Bot online
Ignoring exception in command play:
Traceback (most recent call last):
File "C:\Users\ahmad\PycharmProjects\Discord bot\venv\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\ahmad\PycharmProjects\Discord bot\Rihito bot.py", line 41, in play
if not voice.is_playing():
AttributeError: 'NoneType' object has no attribute 'is_playing'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\ahmad\PycharmProjects\Discord bot\venv\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\ahmad\PycharmProjects\Discord bot\venv\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\ahmad\PycharmProjects\Discord bot\venv\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'is_playing'
`

Bot prefix?

Hi
i'm new to coding and im looking to make a discord music bot.
i typed in your code and found the prefix
load_dotenv() client = commands.Bot(command_prefix='.')
but i dont know the play command and i would like to change the prefix.
can i just do "= "v!" and then use the command v!play in the discord? because i tried to do this but i dosent seem to be working,
is that not an option or is the code not right?
-Crossinq

Readme - dotenv

Dependency list should be modified to clarify that the package to be installed is "python-dotenv" vice "dotenv" which is deprecated.

dotenv

So, this bot wont download dotenv, using PebbleHost to host this bot

To do

  • Add messages when commands are executed succesfully
  • Queue system
  • Have the bot always on
  • Include eventual jokes

venv instructions

Bot could be setup in a venv. Readme could be updated to provide instructions for doing so. This creates greater flexibility for future iterations of this project.

Further development of Bot

I am very excited for the future of the bot, I wanted that if you could add music commands play not just by youtube links/playlist but also by names and spotify and a queue system with it...

Not working

Traceback (most recent call last):
  File "C:\Users\Tenet\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "C:/Users/Tenet/AppData/Local/Programs/Python/Python39/ezv2.py", line 31, in play
    voice = get(client.voice_clients, guild=ctx.guild)
NameError: name 'get' is not defined

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Tenet\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 939, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\Tenet\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 863, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\Tenet\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'get' is not defined

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.