Ejemplo n.º 1
0
 async def economyset(self, ctx):
     if ctx.author is ctx.guild.owner:
         msg = "```"
         for k, v in self.settings.items():
             msg += str(k) + ": " + str(v) + "\n"
         msg += f"\nType {ctx.prefix}help to see the list of commands.```"
         await ctx.send(msg)
     else:
         await ctx.send(embed=lib.NoPerm(), delete_after=config.deltimer)
Ejemplo n.º 2
0
 async def benefitscredits(self, ctx, credits : int=None):
     if ctx.author is ctx.guild.owner:
         if credits:
             self.settings["BENEFITS_CREDITS"] = credits
             await ctx.send("Every benefits claim will now give " + str(credits) + " credits.", delete_after=config.deltimer)
             with open("./data/economy/settings.json", "w") as s:
                 json.dump(self.settings, s)
         else:
             await ctx.send(embed=lib.Editable_E("You Missed Something", "You need to enter an amount", "Economy"), delete_after=config.deltimer)
     else:
         await ctx.send(embed=lib.NoPerm(), delete_after=config.deltimer)
Ejemplo n.º 3
0
 async def benefitstime(self, ctx, seconds : int=None):
     if ctx.author is ctx.guild.owner:
         if seconds:
             self.settings["BENEFITS_TIME"] = seconds
             await ctx.send("Value modified. At least " + str(seconds) + " seconds must pass between each benefits claim.", delete_after=config.deltimer)
             with open("./data/economy/settings.json", "w") as s:
                 json.dump(self.settings, s)
         else:
             await ctx.send(embed=lib.Editable_E("You Missed Something", "You need to enter a benefits delay", "Economy"), delete_after=config.deltimer)
     else:
         await ctx.send(embed=lib.NoPerm(), delete_after=config.deltimer)
Ejemplo n.º 4
0
 async def slottime(self, ctx, seconds : int=None):
     if ctx.author is ctx.guild.owner:
         if seconds:
             self.settings["SLOT_TIME"] = seconds
             await ctx.send("Cooldown is now " + str(seconds) + " seconds.", delete_after=config.deltimer)
             with open("./data/economy/settings.json", "w") as s:
                 json.dump(self.settings, s)
         else:
             await ctx.send(embed=lib.Editable_E("You Missed Something", "You need to enter a slot time.", "Economy"), delete_after=config.deltimer)
     else:
         await ctx.send(embed=lib.NoPerm(), delete_after=config.deltimer)
Ejemplo n.º 5
0
 async def slotmax(self, ctx, bid : int=None):
     if ctx.author is ctx.guild.owner:
         if bid:
             self.settings["SLOT_MAX"] = bid
             await ctx.send("Maximum bid is now " + str(bid) + " credits.", delete_after=config.deltimer)
             with open("./data/economy/settings.json", "w") as s:
                 json.dump(self.settings, s)
         else:
             await ctx.send(embed=lib.Editable_E("You Missed Something", "You need to enter a maximum amount", "Economy"), delete_after=config.deltimer)
     else:
         await ctx.send(embed=lib.NoPerm(), delete_after=config.deltimer)
Ejemplo n.º 6
0
 async def add(self, ctx, user: discord.Member=None, amount : int=None):
     GID = str(ctx.guild.id)
     if ctx.author is ctx.guild.owner or ctx.author.id in config.admins:
         if user and amount:
             if self.account_check(GID, user.id):
                 if self.account_check(GID, ctx.author.id):
                     await ctx.send(embed=lib.Editable("Some kind of wizardry", f"Added {amount} credits to {user.mention}'s balance!", "Devo Bank"), delete_after=config.deltimer)
                     self.add_money(GID, user.id, amount)
                 else:
                     await ctx.send(embed=lib.Editable_E("You dont have a bank account", f"Run {ctx.prefix}bank register to open an account.", "Devo Bank"), delete_after=config.deltimer)
             else:
                 await ctx.send(embed=lib.Editable_E(f"{user.name} has no bank account.", "", "Devo Bank"), delete_after=config.deltimer)
         else:
             await ctx.send(embed=lib.Editable_E("Invalid Arguments", f"Usage Example:\n\n{ctx.prefix}bank add @someone (amount)", "Usage"), delete_after=config.deltimer)
     else:
         await ctx.send(embed=lib.NoPerm(), delete_after=config.deltimer)
Ejemplo n.º 7
0
 async def is_admin(ctx):
     if ctx.message.content.startswith("/"):
         if ctx.author.id in config.admins:
             await ctx.message.delete()
             file = open("./utils/logs/Admin.log", "a")
             file.write("[{}]: Access Granted to {} | CMD - {}\n".format(
                 datetime.datetime.utcnow().strftime(
                     "%d/%m/%Y at %H:%M:%S (System Time)"), ctx.author.id,
                 ctx.message.content))
             file.close()
             return True
         else:
             file = open("./utils/logs/Admin.log", "a")
             file.write("[{}]: Access Denied for {} | CMD - {}\n".format(
                 datetime.datetime.utcnow().strftime(
                     "%d/%m/%Y at %H:%M:%S (System Time)"), ctx.author.id,
                 ctx.message.content))
             file.close()
             await ctx.send(embed=lib.NoPerm())
Ejemplo n.º 8
0
 async def is_moderator(ctx):
     if ctx.author.id in config.admins or ctx.author.guild_permissions.kick_members:
         return True
     else:
         await ctx.send(embed=lib.NoPerm())