GithubHelp home page GithubHelp logo

discord-bot's Introduction

A discord bot

A port of my other bot gobot in python, a language I'm more confortable with.

Features

  • !go played shows your total game time
  • !go reminder <(w)d(x)h(y)m(z)s> [message] reminds you of something in the given time
  • !go play Voice channel name https://www.youtube.com/watch?v=3gxNW2Ulpwk play the youtube audio in the given voice channel
  • !go stop stop the audio

Launch it

All you need is a conf.json file on the same level as bot.py containing :

{
    "email": "[email protected]",
    "password": "my_password",
    "admin_id": "0123456789",
    "prefix": "my_prefix",
    "music": {
        "avconv": false,
        "opus": "path_to_opus_lib"
    }
}

Then launch the bot :

python3.5 bot.py

or launch it in background :

python3.5 bot.py -l bot.log & # Start the bot and logs into 'bot.log'
echo $! > bot.pid # Store its pid in 'bot.pid' file
...
kill `cat bot.pid` # Kill the bot

The bot will respond to every message which begin with my_prefix (try my_prefix help)

Commands

To add commands, just follow the commands already in place.

# Example to tell the bot to say something

# Adding admin=True will only allow the command to the admin user
self.add_command('say', self._command_say, regexp=r'(?P<to_say>\w+)')

async def _command_say(self, message, to_say):
    await self.client.send_message(message.channel, to_say)

And that's it. just write !my_prefix say Hey there! in a channel.

To do

  • Gametime management (at least delete, + admin tool ?)

discord-bot's People

Contributors

gdraynz avatar

Watchers

 avatar  avatar

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.