A plugin to help with saving variables for Discord bots
Project description
Discord Variables Plugin
A plugin to help with saving variables for bots
Documentation:
Server Specific Variables:
- Import package, and create ServerVariables object:
import discord_variables_plugin
serverVars = discord_variables_plugin.ServerVariables()
- To set a server specific variable
# Pass a discord.Guild object for guild
# Pass a string for varName
# Pass any object for value
serverVars.set(guild, varName, value)
- To get a server specific variable
# Pass a discord.Guild object for guild
# Pass a string for varName
# Returns the object stored in varName of guild
# Returns -1 if varName isn't a variable on the server
varNameValue = serverVars.get(guild, varName)
- To delete a saved server
# Pass a discord.Guild object for guild
# Returns -1 if the server doesn't exist in the ServerVariables object
serverVars.removeServer(guild)
- To remove a variable of a server
# Pass discord.Guild for guild
# Pass a string for varName
# Returns -1 if varName isn't a variable on the server
serverVars.removeVar(guild, varName)
- To save the server variables
# Pass a file path as fp
# Returns -1 if there was an error saving
serverVars.save(fp)
- To load the server variables
# Pass a file path as fp
# Returns -1 if there was an error loading
serverVars.load(fp)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for discord_variables_plugin-1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d98039b25faadcfc1cb116652dbe87ffc6ebfe6e24eae8ca6402d457f078029c |
|
MD5 | c3d98cbf79d404881e74cad90ddf4074 |
|
BLAKE2b-256 | ff097fc07cb94b6958a31578b582a75d6ead8b159409af130703757eb90cfb05 |