errite.da package¶
Submodules¶
errite.da.daParser module¶
errite.da.debugJsonTools module¶
DeviantCord 2 Discord Bot Copyright (C) 2020 Errite Games LLC/ ErriteEpticRikez
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
errite.da.jsonTools module¶
DeviantCord 2 Discord Bot Copyright (C) 2020 Errite Games LLC/ ErriteEpticRikez
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
-
errite.da.jsonTools.
allartistExists
(artist)¶ Method ran to check if an allartist is already in the ArtData json file.
Parameters: artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references Returns: bool
-
errite.da.jsonTools.
artistExists
(artist)¶ Method ran to check if a artist is already in the ArtData json file.
Parameters: artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references Returns: bool
-
errite.da.jsonTools.
createArtistData
(artist, folderid, foldername, channelid, inverted)¶ Method ran to create a new artist in the ArtData json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- folderid (string) – The UUID of the folder that we are adding to the ArtData json file
- foldername (string) – The name of the gallery folder we are working with. Used for json references
- channelid (int) – The Discord channelid that notifications will be posted to.
- inverted – Whether the newest deviations are posted at the top.
-
errite.da.jsonTools.
createArtistDataAll
(artist, channelid, inverted)¶ Method ran to create a new artist in the ArtData json file. With no new folder, but an allfolder only
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- channelid (int) – The Discord channelid that notifications will be posted to.
- inverted – Whether the newest deviations are posted at the top.
-
errite.da.jsonTools.
createFolderData
(artist, folderid, foldername, channelid, inverted)¶ Method ran to create a new folder to an existing artist in the ArtData json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- folderid (string) – The UUID of the folder that we are adding to the ArtData json file
- foldername (string) – The name of the gallery folder we are working with. Used for json references
- channelid (int) – The Discord channelid that notifications will be posted to.
- inverted – Whether the newest deviations are posted at the top.
-
errite.da.jsonTools.
delAllFolder
(artist)¶ Method ran to delete a folder in the ArtData json file.
Parameters: artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
-
errite.da.jsonTools.
delfolder
(artist, folder)¶ Method ran to delete a folder in the ArtData json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – The name of the gallery folder we are working with. Used for json references
Returns: bool
-
errite.da.jsonTools.
dumpURLListDebug
(list)¶
-
errite.da.jsonTools.
findDuplicateElementArray
(array, element)¶ Method ran to check if a Deviation UUID is already in the array.
Parameters: - array – The array that holds the current processed uuids for the particular artist
- element (string) – The UUID we are comparing with the JSON file.
- artist (string) – UNUSED TO BE REMOVED The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – May be reused: The name of the gallery folder we are working with. Used for json references
Returns: bool
-
errite.da.jsonTools.
findDuplicateJsonElementGallery
(file, element, artist, foldername)¶ Method ran to check if a Deviation UUID is already in the ArtData json file.
Parameters: - file (string) – UNUSED The name of the json file that would be used to compare the provided UUID with existing UUID’s
- element (string) – The UUID we are comparing with the JSON file.
- artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – The name of the gallery folder we are working with. Used for json references
Returns: bool
-
errite.da.jsonTools.
folderExists
(artist, foldername)¶ Method ran to check if a folder is already in the ArtData json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – The name of the gallery folder we are working with. Used for json references
Returns: bool
-
errite.da.jsonTools.
hasAllFolder
(artist)¶
-
errite.da.jsonTools.
localFoldersExists
(dictionary, artist)¶ Method ran to check if there are folders already in the ArtData json file.
Parameters: artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references Returns: bool
-
errite.da.jsonTools.
updateDiscordChannel
(artist, foldername, newchannelid)¶ Method ran to update a listeners discord channel id in the ArtData json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – The name of the gallery folder we are working with. Used for json references
- newchannelid (int) – The Discord channelid that notifications will be posted to.
-
errite.da.jsonTools.
updateRole
(roleid, guildid)¶ Method ran to update the role that commands check for to make sure a user is authorized.
Parameters: roleid (int) – The roleid that will become the central role to the bot.
-
errite.da.jsonTools.
update_errite
(property)¶ Method ran to toggle the errite property in the config.json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – The name of the gallery folder we are working with. Used for json references
- hybrid (bool) – The value the new hybrid should be in the Json file
-
errite.da.jsonTools.
updatehybridproperty
(artist, foldername, hybrid)¶ Method ran to update a listeners discord channel id in the ArtData json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – The name of the gallery folder we are working with. Used for json references
- hybrid (bool) – The value the new hybrid should be in the Json file
-
errite.da.jsonTools.
updateinverseproperty
(artist, foldername, inverse)¶ Method ran to update a listeners discord channel id in the ArtData json file.
Parameters: - artist (string) – The name of the artist who’s deviations we are working with. This is needed for json references
- foldername (string) – The name of the gallery folder we are working with. Used for json references
- inverse (bool) – The value the new inverse should be in the Json file
-
errite.da.jsonTools.
updatelogchannel
(channelid)¶ Method ran to update the logchannelid handles debug logging.
Parameters: channelid (int) – The roleid that will become the central role to the bot.
-
errite.da.jsonTools.
updateprefix
(prefix)¶ Method ran to update the prefix that commands use check for to make sure a user is authorized.
Parameters: prefix (string) – The new prefix that will replace the old one