Skip to content
Permalink
Browse files
Added bot status
  • Loading branch information
hollan84 committed May 13, 2020
1 parent 75139aa commit f110250b995ca8865d84bc82fc90d873aa2e893a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
@@ -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)

@@ -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:
@@ -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)

0 comments on commit f110250

Please sign in to comment.