Skip to main content

Easy config module for Discord bots

Project description

discord-config is a Python library to help saving and loading configuration files.

Warning: Still in development, so use with care!


discord-config is available on PyPI under discord_config:

$ pip install -U discord_config

Or for the latest development version:

$ pip install -U git+

Basic Example

from discord_config import Settings

# (settings will be saved by default to settings.json, if it is not defined)
settings = Settings()

print (settings)
print (settings.token) #> "...yourtoken..."
print (settings.server_id) #> "123123123"

settings.clear() # Clears the settings

# You can define arbitrary settings to Settings object defaults
settings = Settings(defaults = {
    "token": "...yourtoken...",
    "botname": "MyDiscordBot",
    "joinservers": False,
    "idleTimer": 100

print (settings)
print (settings.token) #> "...yourtoken..."
print (settings.botname) #> "...MyDiscordBot..."
print (settings.joinservers) #> False
print (settings.idleTimer) #> 100

# Defaults were overwritten
    print (settings.server_id)
except Exception as e:
     #> AttributeError: 'Settings' object has no attribute 'server_id'

settings.set('id', 'broker')

print ( #> 100 # outputs settings.json by default

settings = Settings() # Now it loads settings.json

print (settings)



See the documentation at

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for discord-config, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size discord_config-0.0.2-py3-none-any.whl (6.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size discord_config-0.0.2.tar.gz (4.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page