Coder Social home page Coder Social logo

pcbot's Introduction

PCBOT

WIP discord bot using discord.py.

PCBOT should be supported by all python versions above 3.4.2. It is however only tested and developed in python 3.4.4, so please give me a yell if something is unsupported.

Installing

The bot itself requires no extra python modules, although prank plugin needs Pillow. To install the bot, one can clone the repo:

git clone https://github.com/PcBoy111/PCBOT.git

Or, just simply download the repo as ZIP.

Running

Running the bot is simple. Go to the root directory of the bot, and run bot.py:

python bot.py

You should get a prompt asking for your bot token. If you want to login to a regular account, use the --email/-e token like so:

python bot.py --email EMAIL

The bot will prompt for a password the first time you login with an email. For more information, see Command-line arguments

Assigning ownership

After running the bot for the first time, you want to make sure you're assigned the owner account. This process is very straight-forward and requires that you have access to the bot log, and can respond to the bot within 60 seconds of reading the log (By default, the log is printed to the terminal).

The first step is to send the command !setowner in a private message. The bot will wait for a response matching the 3-digit code logged to the console. The logged message looks something like this:

CRITICAL [bot] 2016-04-24 23:03:49,138: Owner code for assignment: 263

After sending the code in a private message, in this case 263, your account will be registered as the bot owner.

Command-line arguments

Execute python bot.py -h to see a list of supported command-line arguments.

Plugins

PCBOT has a folder based plugin system. The plugins do not need any specific imports (other than discord of course). A template plugin can be found in the plugins/ folder.

To remove an unwanted plugin from the bot, simply remove it from the plugins/ folder. This process of handling plugins will soon be migrated to a blacklist system.

Currently, the owner can reload, unload and load plugins with the !plugin command:

Option Function
!plugin list all loaded plugins
!plugin reload [plugin] reload all or the specified plugin
!plugin unload <plugin> unload a plugin temporarily
!plugin load <plugin> load a plugin from the plugins/ folder

When building plugins, make sure you're using syntax supported by your version of python. Considering the bot is built for version 3.4.2+, the best would be to follow this syntax.

pcbot's People

Contributors

pckv avatar

Watchers

 avatar  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.