mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-09 12:48:54 -05:00
commit
38881cf71d
@ -108,7 +108,7 @@ class Economy:
|
|||||||
if self.account_check(id):
|
if self.account_check(id):
|
||||||
if id in self.payday_register:
|
if id in self.payday_register:
|
||||||
seconds = abs(self.payday_register[id] - int(time.perf_counter()))
|
seconds = abs(self.payday_register[id] - int(time.perf_counter()))
|
||||||
if seconds >= self.settings["PAYDAY_TIME"]:
|
if seconds >= self.settings["PAYDAY_TIME"]:
|
||||||
self.add_money(id, self.settings["PAYDAY_CREDITS"])
|
self.add_money(id, self.settings["PAYDAY_CREDITS"])
|
||||||
self.payday_register[id] = int(time.perf_counter())
|
self.payday_register[id] = int(time.perf_counter())
|
||||||
await self.bot.say("{} Here, take some credits. Enjoy! (+{} credits!)".format(author.mention, str(self.settings["PAYDAY_CREDITS"])))
|
await self.bot.say("{} Here, take some credits. Enjoy! (+{} credits!)".format(author.mention, str(self.settings["PAYDAY_CREDITS"])))
|
||||||
@ -213,10 +213,10 @@ class Economy:
|
|||||||
async def economyset(self, ctx):
|
async def economyset(self, ctx):
|
||||||
"""Changes economy module settings"""
|
"""Changes economy module settings"""
|
||||||
if ctx.invoked_subcommand is None:
|
if ctx.invoked_subcommand is None:
|
||||||
msg = ""
|
msg = "```"
|
||||||
for k, v in self.settings.items():
|
for k, v in self.settings.items():
|
||||||
msg += str(k) + ": " + str(v) + "\n"
|
msg += str(k) + ": " + str(v) + "\n"
|
||||||
msg += "\nType help economyset to see the list of commands."
|
msg += "\nType {}help economyset to see the list of commands.```".format(ctx.prefix)
|
||||||
await self.bot.say(msg)
|
await self.bot.say(msg)
|
||||||
|
|
||||||
@economyset.command()
|
@economyset.command()
|
||||||
@ -286,7 +286,7 @@ class Economy:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def set_money(self, id, amount):
|
def set_money(self, id, amount):
|
||||||
if self.account_check(id):
|
if self.account_check(id):
|
||||||
self.bank[id]["balance"] = amount
|
self.bank[id]["balance"] = amount
|
||||||
fileIO("data/economy/bank.json", "save", self.bank)
|
fileIO("data/economy/bank.json", "save", self.bank)
|
||||||
return True
|
return True
|
||||||
@ -301,7 +301,7 @@ class Economy:
|
|||||||
('minutes', 60),
|
('minutes', 60),
|
||||||
('seconds', 1),
|
('seconds', 1),
|
||||||
)
|
)
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
for name, count in intervals:
|
for name, count in intervals:
|
||||||
@ -341,4 +341,4 @@ def setup(bot):
|
|||||||
handler = logging.FileHandler(filename='data/economy/economy.log', encoding='utf-8', mode='a')
|
handler = logging.FileHandler(filename='data/economy/economy.log', encoding='utf-8', mode='a')
|
||||||
handler.setFormatter(logging.Formatter('%(asctime)s %(message)s', datefmt="[%d/%m/%Y %H:%M]"))
|
handler.setFormatter(logging.Formatter('%(asctime)s %(message)s', datefmt="[%d/%m/%Y %H:%M]"))
|
||||||
logger.addHandler(handler)
|
logger.addHandler(handler)
|
||||||
bot.add_cog(Economy(bot))
|
bot.add_cog(Economy(bot))
|
||||||
|
|||||||
@ -316,4 +316,4 @@ class NewPoll():
|
|||||||
def setup(bot):
|
def setup(bot):
|
||||||
n = General(bot)
|
n = General(bot)
|
||||||
bot.add_listener(n.check_poll_votes, "on_message")
|
bot.add_listener(n.check_poll_votes, "on_message")
|
||||||
bot.add_cog(n)
|
bot.add_cog(n)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user