# Path: bot/commands/abstract/command.py
# class Command(ABC):
#     """Represents a command, a way of reacting to chat messages."""
# 
#     perm = Permission.Admin
# 
#     def __init__(self, bot):
#         """Initialize the command."""
#         pass
# 
#     def match(self, bot, user, msg, tag_info):
#         """Return whether this command should be run."""
#         return False
# 
#     def run(self, bot, user, msg, tag_info):
#         """Run this command."""
#         pass
# 
#     def close(self, bot):
#         """Clean up."""
#         pass
# 
# Path: bot/utilities/tools.py
# def replace_vars(msg, args):
#     """Replace the variables in the message."""
#     oldmsg = msg
#     newmsg = msg
# 
#     for key in args:
#         newmsg = newmsg.replace(key, str(args[key]))
#         """Check if something was replaced, otherwise something went wrong."""
#         if newmsg is oldmsg:
#             print("ERROR: Could not replace variable in string!")
# 
#         oldmsg = newmsg
#     return newmsg


import time
from bot.commands.abstract.command import Command
from bot.utilities.permission import Permission
from bot.utilities.tools import replace_vars
        amount = int(cmd[2].lower().strip())

        """Check when the user tipped last."""
        if user in self.tiptimer.keys():
            if (time.time() - self.tiptimer[user]) < self.tipcooldown:
                timer = int(self.tipcooldown - time.time() + self.tiptimer[user])
                cooldown = int(self.tipcooldown / 60)
                var = {"<USER>": user, "<TIMER>": timer, "<COOLDOWN>": cooldown}
                bot.write(replace_vars(self.responses["cooldown"]["msg"], var))
                return

        """Only allow integers between mintip and maxtip."""

        if amount < self.mintip or amount > self.maxtip:
            var = {"<MINTIP>": self.mintip, "<MAXTIP>": self.maxtip}
            bot.write(replace_vars(self.responses["numbererror"]["msg"], var))
            return

        """If the user has enough points transfer them to the target
        and set tiptimer."""
        if bot.ranking.get_points(user) >= amount:
            bot.ranking.increment_points(user, -amount, bot)
            bot.ranking.increment_points(target, amount, bot)
            typeemote = self.get_type_emote(amount)
            var = {
                "<USER>": user,
                "<TARGET>": target,
                "<AMOUNT>": amount,
                "<TYPE>": typeemote,
            }

# Path: bot/commands/abstract/command.py
# class Command(ABC):
#     """Represents a command, a way of reacting to chat messages."""
# 
#     perm = Permission.Admin
# 
#     def __init__(self, bot):
#         """Initialize the command."""
#         pass
# 
#     def match(self, bot, user, msg, tag_info):
#         """Return whether this command should be run."""
#         return False
# 
#     def run(self, bot, user, msg, tag_info):
#         """Run this command."""
#         pass
# 
#     def close(self, bot):
#         """Clean up."""
#         pass
# 
# Path: bot/utilities/tools.py
# def replace_vars(msg, args):
#     """Replace the variables in the message."""
#     oldmsg = msg
#     newmsg = msg
# 
#     for key in args:
#         newmsg = newmsg.replace(key, str(args[key]))
#         """Check if something was replaced, otherwise something went wrong."""
#         if newmsg is oldmsg:
#             print("ERROR: Could not replace variable in string!")
# 
#         oldmsg = newmsg
#     return newmsg


# Path: bot/commands/tip.py
import time
from bot.commands.abstract.command import Command
from bot.utilities.permission import Permission
from bot.utilities.tools import replace_vars

        amount = int(cmd[2].lower().strip())

        """Check when the user tipped last."""
        if user in self.tiptimer.keys():
            if (time.time() - self.tiptimer[user]) < self.tipcooldown:
                timer = int(self.tipcooldown - time.time() + self.tiptimer[user])
                cooldown = int(self.tipcooldown / 60)
                var = {"<USER>": user, "<TIMER>": timer, "<COOLDOWN>": cooldown}
                bot.write(replace_vars(self.responses["cooldown"]["msg"], var))
                return

        """Only allow integers between mintip and maxtip."""

        if amount < self.mintip or amount > self.maxtip:
            var = {"<MINTIP>": self.mintip, "<MAXTIP>": self.maxtip}
            bot.write(replace_vars(self.responses["numbererror"]["msg"], var))
            return

        """If the user has enough points transfer them to the target
        and set tiptimer."""
        if bot.ranking.get_points(user) >= amount:
            bot.ranking.increment_points(user, -amount, bot)
            bot.ranking.increment_points(target, amount, bot)
            typeemote = self.get_type_emote(amount)
            var = {
                "<USER>": user,
                "<TARGET>": target,
                "<AMOUNT>": amount,
                "<TYPE>": typeemote,
            }

            bot.write(replace_vars(self.responses["tipsend"]["msg"], var))