Skip to content
Permalink
1e015ff413
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 40 lines (35 sloc) 1.91 KB
import database
from googletrans import Translator
def help(user_message, prefix, guild_id):
commands = {
"server" : "Displays the saved server address",
"status" : "Gets the status of the server along with players (players only display if the server allows it)",
"minecraftNickname" : "Sets the nickname of a username to allow easy recognition when using the status command",
"download" : "Gives the world download link if there is one available",
"map": "Gives the map link if there is one available (usually using dynmap)",
"settings" : "Sets the server settings of this bot. Requires the role 'Minecraft Bot' to change",
"source" : "Gives the bot source code from Github",
"share" : "Add the bot to other servers",
"botinfo" : "Get information on the bot",
"version" : "Gives the bot release version"
}
msg = ""
for command in commands:
if command in user_message:
msg = "{}{} - {}".format(prefix, command, commands[command])
if len(msg) == 0:
msg = "Commands:\n"
for command in commands:
if command == "map" or command == "download":
if database.read_database(command, guild_id) is not None:
msg = "{}- {}{}\n".format(msg, prefix, command)
else:
msg = "{}- {}{}\n".format(msg, prefix, command)
msg = "{}If you want more information on a specific command use '{}help [command name]'".format(msg, prefix)
def language(user_message, guild_id):
if database.read_database("language", guild_id) != "en": #If the server is not set as english
translator = Translator()
user_message = user_message[len(prefix):]
user_message = translator.translate(user_message, src=database.read_database("language", guild_id), dest='en') #Translate the message to English
user_message = "{}{}".format(prefix,user_message.text) #Rebuild message
return user_message.lower() #Returns the lowercase message