From 595c1307ca602bef7e39f6ebcfdc3ae2892cb17c Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 14 Sep 2021 05:38:28 +0300 Subject: [PATCH] (Economy): Add event log on `send` transfer. Also make the input a bit more flexible. --- bot/modules/economy/send_cmd.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bot/modules/economy/send_cmd.py b/bot/modules/economy/send_cmd.py index 3e15a9ec..0a6b0db8 100644 --- a/bot/modules/economy/send_cmd.py +++ b/bot/modules/economy/send_cmd.py @@ -2,6 +2,7 @@ import discord import datetime from cmdClient.checks import in_guild +from settings import GuildSettings from core import Lion from .module import module @@ -27,7 +28,7 @@ async def cmd_send(ctx): splits = ctx.args.split() digits = [split.isdigit() for split in splits] mentions = ctx.msg.mentions - if len(splits) != 2 or not any(digits) or not (all(digits) or mentions): + if len(splits) < 2 or not any(digits) or not (all(digits) or mentions): return await _send_usage(ctx) if all(digits): @@ -70,6 +71,14 @@ async def cmd_send(ctx): ).set_footer(text=str(ctx.author), icon_url=ctx.author.avatar_url) await ctx.reply(embed=embed, reference=ctx.msg) + await GuildSettings(ctx.guild.id).event_log.post( + "{} sent {} `{}` LionCoins.".format( + ctx.author.mention, + target.mention, + amount + ), + title="Funds transferred" + ) async def _send_usage(ctx):