Skip to content

Commit

Permalink
use discord timestamps for userinfo, add missing f string (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
ASF007 authored May 8, 2022
1 parent d59e7ba commit d36a751
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion GearBot/GearBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def initialize(bot):
else:
bot.redis_pool = await aioredis.create_redis_pool(socket, encoding="utf-8", db=0, maxsize=3)

GearbotLogging.info("Cluster {bot.cluster} redis connection established")
GearbotLogging.info(f"Cluster {bot.cluster} redis connection established")
await GearbotLogging.bot_log(
f"{Emoji.get_chat_emoji('YES')} Cluster {bot.cluster} redis connection established, let's go full speed!")

Expand Down
7 changes: 4 additions & 3 deletions GearBot/Util/server_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@
import datetime

import disnake
from disnake import utils

from Util import Translator, Emoji, Utils, Configuration


def server_info_embed(guild, request_guild=None):
guild_features = ", ".join(guild.features)
guild_features = ", ".join(guild.features).title().replace("_", " ")
if guild_features == "":
guild_features = None
guild_made = guild.created_at.strftime("%d-%m-%Y")
guild_made = guild.created_at
embed = disnake.Embed(color=guild.roles[-1].color, timestamp=datetime.datetime.utcfromtimestamp(time.time()).replace(tzinfo=datetime.timezone.utc))
if guild.icon is not None:
embed.set_thumbnail(url=guild.icon.url)
Expand All @@ -29,7 +30,7 @@ def server_info_embed(guild, request_guild=None):
)
embed.add_field(
name=Translator.translate('created_at', request_guild),
value=f"{guild_made} ({(datetime.datetime.utcfromtimestamp(time.time()).replace(tzinfo=datetime.timezone.utc) - guild.created_at).days} days ago)",
value=f"{utils.format_dt(guild_made, 'F')} ({utils.format_dt(guild_made, 'R')})",
inline=True
)
embed.add_field(
Expand Down

0 comments on commit d36a751

Please sign in to comment.