diff --git a/lib/bot.py b/lib/bot.py index d18de0c..d08a27f 100755 --- a/lib/bot.py +++ b/lib/bot.py @@ -20,9 +20,13 @@ load_dotenv() token = os.environ['TOKEN'] client = discord.Client() + + @client.event async def on_ready(): - print(f'{client.user} has connected to Discord!') + print(f'{client.user} has connected to Discord!') + status = "{} different servers".format(database.get_total("*")) + await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=status)) @client.event async def on_message(message): @@ -32,6 +36,8 @@ async def on_message(message): if database.guild_check(guild_id) == False: guild_name = str(message.guild) database.new_guild(guild_id, guild_name) + status = "{} different servers".format(database.get_total("*")) + await client.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=status)) prefix = database.read_database("command_prefix", guild_id) diff --git a/lib/settings.py b/lib/settings.py index e1f3455..1ea0731 100755 --- a/lib/settings.py +++ b/lib/settings.py @@ -2,7 +2,7 @@ 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 [Box Prefix ('?' by default)", "map [URL of online map]", "download [World download link]"] + 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: diff --git a/markdowngen.py b/markdowngen.py new file mode 100755 index 0000000..720f368 --- /dev/null +++ b/markdowngen.py @@ -0,0 +1,16 @@ +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: + msg = "{}* {} - {}\n".format(msg, command, commands[command]) +print(msg) \ No newline at end of file