DiscordPy Guild Data Management Module
Project description
JSON READER:
DiscordPy GuildData Management Module
Important Info:
A /data folder must exist
Common Terms:
key: file name to save/pull from (Stored as guild_KEY.json) guild: ID of the guild (automatically turned into a string)
Functions
create_file()
Creates a Key
Returns: Success(T/F)
ex.
if(guildreader.create_file(self.bot, "mutes", {}))
- bot: Bot Instance
- key: File/Key to make
- default: Default value stored for each guild
- wipe: Wipes the file if it exists
read_file()
ex.
data = guildreader.read_file(ctx.guild.id, "mutes")
data[USER] = int(time.time+300)
Read a Key from a guild ID
Returns: JSON for that guild
- guild: ID of the guild
- key: File/Key to read
write_file()
ex.
guildreader.write_file(ctx.guild.id, "mutes", data)
Write to a key
Returns: Success(T/F)
- guild: ID of the guild
- key: File/Key to read
- value: Modified Value
remove()
Remove a guild from a Key
Returns: Success(T/F)
ex.
def on_guild_remove(self, guild):
guildreader.remove(guild.id, "mutes")
- guild: ID of the guild
- key: File/Key to remove guild from
check_exist()
if(guildreader.check_exists("mutes"))
Checks if a Key exists
Returns: Success(T/F)
- key: Check the existance of a key/file
dump()
json = guildreader.dump("mutes")
Dumps the entire JSON
Returns: JSON of the Key
- key: Key to dump full json from
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 Distribution
guildreader-1.1.4.tar.gz
(3.0 kB
view hashes)
Built Distributions
guildreader-1.1.4-py3.8.egg
(4.8 kB
view hashes)
Close
Hashes for guildreader-1.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f8e54fddbe9658680e84661531fa4cefa1e7811a6f1f9ef7505cb137d79b721 |
|
MD5 | f256d8cfe2b7a59198a5de0b170a42e4 |
|
BLAKE2b-256 | 98e3326c76a0f687aadf923b693369c58fdcf1a0b0d42a981e7134a2e00d1927 |