소스 검색

updated about command, added it to the docs, and fixed a big with parsing the backup rate.

tags/v2.0.0
Roxie Gibson 5 년 전
부모
커밋
ceab32ccc4
3개의 변경된 파일20개의 추가작업 그리고 8개의 파일을 삭제
  1. +9
    -0
      docs/commands.md
  2. +10
    -6
      roxbot.py
  3. +1
    -2
      roxbot/__init__.py

+ 9
- 0
docs/commands.md 파일 보기

## Core Commands ## Core Commands
These are the base commands for Roxbot that are a part of the core bot. All of them deal with internal management and are, for the most part, unavailable to average users. These are the base commands for Roxbot that are a part of the core bot. All of them deal with internal management and are, for the most part, unavailable to average users.


### ;about

Outputs info about RoxBot, showing up time, how to report issues, contents of roxbot.conf and credits.
Command Structure:

`;about`


### ;backup ### ;backup


!!! warning "Required Permissions" !!! warning "Required Permissions"

+ 10
- 6
roxbot.py 파일 보기

@bot.command() @bot.command()
async def about(ctx): async def about(ctx):
""" """
Outputs info about RoxBot, showing up time, how to report issues, what settings where set in prefs.ini and credits.
Outputs info about RoxBot, showing up time, how to report issues, contents of roxbot.conf and credits.
""" """
owner = bot.get_user(roxbot.owner) owner = bot.get_user(roxbot.owner)
em = discord.Embed(title="About Roxbot", colour=roxbot.EmbedColours.pink, description=roxbot.__description__) em = discord.Embed(title="About Roxbot", colour=roxbot.EmbedColours.pink, description=roxbot.__description__)
em.set_thumbnail(url=bot.user.avatar_url) em.set_thumbnail(url=bot.user.avatar_url)
em.add_field(name="Command Prefix", value=roxbot.command_prefix)
em.add_field(name="Bot Version", value=roxbot.__version__)
em.add_field(name="Discord.py version", value=discord.__version__)
em.add_field(name="Owner", value=str(owner)) em.add_field(name="Owner", value=str(owner))
em.add_field(name="Owner ID", value=roxbot.owner) em.add_field(name="Owner ID", value=roxbot.owner)
em.add_field(name="Bot Version", value=roxbot.__version__)
em.add_field(name="Command Prefix", value=roxbot.command_prefix)
em.add_field(name="Backup Enabled", value=roxbot.backup_enabled)
if roxbot.backup_enabled:
em.add_field(name="Backup Rate", value="{} Minutes".format(int(roxbot.backup_rate/60)))

em.add_field(name="Author", value=roxbot.__author__) em.add_field(name="Author", value=roxbot.__author__)
em.add_field(name="Discord.py version", value=discord.__version__)
em.set_footer(text="RoxBot is licensed under the MIT License")



# Do time calc late in the command so that the time returned is closest to when the message is received # Do time calc late in the command so that the time returned is closest to when the message is received
uptimeflo = time.time() - start_time uptimeflo = time.time() - start_time
uptime = str(datetime.timedelta(seconds=uptimeflo)) uptime = str(datetime.timedelta(seconds=uptimeflo))
em.add_field(name="Current Uptime", value=str(uptime.split(".")[0])) em.add_field(name="Current Uptime", value=str(uptime.split(".")[0]))
em.set_footer(text="RoxBot is licensed under the MIT License")
return await ctx.channel.send(embed=em) return await ctx.channel.send(embed=em)





+ 1
- 2
roxbot/__init__.py 파일 보기



Roxbot also has a focus on being inclusive and being fun for all kinds of people. Roxbot is a bot written by a queer woman with the lgbt community in mind. Roxbot also has a focus on being inclusive and being fun for all kinds of people. Roxbot is a bot written by a queer woman with the lgbt community in mind.



[Github link](https://github.com/roxxers/roxbot) [Github link](https://github.com/roxxers/roxbot)
[Changelog](https://github.com/roxxers/roxbot/blob/master/CHANGELOG.md) [Changelog](https://github.com/roxxers/roxbot/blob/master/CHANGELOG.md)
[Docs](https://roxxers.github.io/roxbot/) [Docs](https://roxxers.github.io/roxbot/)
backup_enabled = False backup_enabled = False
else: else:
backup_enabled = True backup_enabled = True
backup_rate = config["Backups"]["rate"] * 60 # Convert minutes to seconds
backup_rate = int(config["Backups"]["rate"]) * 60 # Convert minutes to seconds




datetime_formatting = "{:%a %Y/%m/%d %H:%M:%S} UTC" datetime_formatting = "{:%a %Y/%m/%d %H:%M:%S} UTC"

Loading…
취소
저장