Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
NativeMinecraftDiscord/lib/settings.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
18 lines (18 sloc)
1.08 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import database | |
def settings(message, guild_id): | |
prefix = database.read_database("command_prefix", guild_id) | |
if "help" in message.lower(): | |
setting_list = ["minecraft_server [URL of Server]", "server_port [Server Port]", "command_prefix [Bot Prefix ('?' by default)", "map [URL of online map]", "download [World download link]"] | |
msg = "Use the setting function to change settings of this bot for your server " | |
msg = msg + "\nUse the following commands to change the settings" | |
for i in setting_list: | |
msg = "{}\n - {}settings {}".format(msg, prefix, i) | |
return msg | |
splitMessage = message.split() | |
try: | |
command = str(splitMessage[0]) | |
database.modify_database(splitMessage[(splitMessage.index(command)) + 1], splitMessage[(splitMessage.index(command)) + 2], guild_id) | |
msg = "{} has been set to {}".format((splitMessage[(splitMessage.index(command)) + 1]), (splitMessage[(splitMessage.index(command)) + 2])) | |
except: | |
return "Not an available setting, use '{}settings help' for help".format(prefix) | |
return msg |