예제 #1
0
파일: Waifu.py 프로젝트: alisenai/Alien-Bot
 def __init__(self, mod_name, embed_color):
     # Config var init
     self.config = DataManager.JSON("Mods/Waifu/WaifuConfig.json")
     # Make sure all gifts follow a proper naming convention
     for gift_name in self.config.get_data("Gifts"):
         if not re.fullmatch(r"[A-Za-z0-9 ]*", gift_name):
             raise Exception(
                 "Waifu gift name \"%s\" can only contain spaces, A-Z, a-z, 0-9"
                 % gift_name)
     # Build command objects
     self.commands = Utils.parse_command_config(
         self, mod_name, self.config.get_data('Commands'))
     # Init DBs
     self.waifus_db = DataManager.add_manager(
         "shop_database",
         "Mods/Waifu/Waifus.db",
         file_type=DataManager.FileType.SQL)
     self.gifts_db = DataManager.add_manager(
         "shop_database",
         "Mods/Waifu/Gifts.db",
         file_type=DataManager.FileType.SQL)
     # Generate and Update DB
     self.generate_db()
     # Super...
     super().__init__(mod_name, self.config.get_data("Mod Description"),
                      self.commands, embed_color)
예제 #2
0
파일: Shops.py 프로젝트: alisenai/Alien-Bot
 def __init__(self, mod_name, embed_color):
     # Config var init
     self.config = DataManager.JSON("Mods/Shops/ShopsConfig.json")
     self.delete_delay = self.config.get_data("Message Delete Delay")
     # Init shop DB
     self.shop_info_database = DataManager.add_manager(
         "shop_info_database",
         "Mods/Shops/ShopsInfo.db",
         file_type=DataManager.FileType.SQL)
     self.shops_database = DataManager.add_manager(
         "shops_database",
         "Mods/Shops/Shops.db",
         file_type=DataManager.FileType.SQL)
     # Create a shop table withing the DB if there isn't one
     self.shop_info_database.execute(
         "CREATE TABLE IF NOT EXISTS shops(channel_id TEXT UNIQUE, shop_name TEXT, is_purge BIT)"
     )
     self.shop_info_database.execute(
         "CREATE TABLE IF NOT EXISTS messages(shop_name TEXT UNIQUE, message_id TEXT, channel_id TEXT)"
     )
     # Verify DB - Check for deleted channels that shops exist in
     self.verify_db()
     # Build command objects
     self.commands = Utils.parse_command_config(
         self, mod_name, self.config.get_data('Commands'))
     # Init the super with all the info from this mod
     super().__init__(mod_name, self.config.get_data('Mod Description'),
                      self.commands, embed_color)
예제 #3
0
 def __init__(self, mod_name, embed_color):
     super().__init__(mod_name, "Just an example mod.", {}, embed_color)
     # Config var init
     self.config = DataManager.JSON("Mods/Gamble/GambleConfig.json")
     # Build command objects
     self.commands = Utils.parse_command_config(self, mod_name, self.config.get_data('Commands'))
     # Init the super with all the info from this mod
     super().__init__(mod_name, self.config.get_data('Mod Description'), self.commands, embed_color)
예제 #4
0
 def __init__(self, mod_name, embed_color):
     # Config var init
     self.config = DataManager.JSON(
         "Mods/DailyEconomy/DailyEconomyConfig.json")
     # Build command objects
     self.commands = Utils.parse_command_config(
         self, mod_name, self.config.get_data('Commands'))
     # Init the super with all the info from this mod
     super().__init__(mod_name, self.config.get_data('Mod Description'),
                      self.commands, embed_color)
예제 #5
0
파일: Gacha.py 프로젝트: alisenai/Alien-Bot
 def __init__(self, mod_name, embed_color):
     super().__init__(mod_name, "Just an example mod.", {}, embed_color)
     # Config var init
     self.config = DataManager.JSON("Mods/Gacha/GachaConfig.json")
     # Init DBs
     self.gacha_database = DataManager.add_manager("gacha_database", "Mods/Gacha/GachaDatabase.db",
                                                   file_type=DataManager.FileType.SQL)
     self.generate_db()
     # Build command objects
     self.commands = Utils.parse_command_config(self, mod_name, self.config.get_data('Commands'))
     # Init the super with all the info from this mod
     super().__init__(mod_name, self.config.get_data('Mod Description'), self.commands, embed_color)
예제 #6
0
 def __init__(self, mod_name, embed_color):
     # General var init
     self.users = {}
     self.roles = {}
     self.name = mod_name
     self.embed_color = embed_color
     # Config var init
     self.config = json.loads("".join(
         open("Mods/ColoredRoles/ColoredRolesConfig.json",
              encoding="utf-8").readlines()))
     # Build command objects
     self.commands = Utils.parse_command_config(self, mod_name,
                                                self.config['Commands'])
     # Generate a fresh DB
     self.generate_db()
     # Init the super with all the info from this mod
     super().__init__(mod_name, self.config['Mod Description'],
                      self.commands, embed_color)
예제 #7
0
 def __init__(self, mod_name, embed_color):
     # General var init
     self.name = mod_name
     self.embed_color = embed_color
     self.applied_interest = False
     # Config var init
     self.config = DataManager.JSON("Mods/Economy/EconomyConfig.json")
     # Set the currency for mods to use
     EconomyUtils.currency = self.config.get_data("Currency")
     # Build command objects
     self.commands = Utils.parse_command_config(
         self, mod_name, self.config.get_data('Commands'))
     # Generate Update and Init DBs
     EconomyUtils.init_database()
     self.generate_db()
     # Init the super with all the info from this mod
     super().__init__(mod_name, self.config.get_data('Mod Description'),
                      self.commands, embed_color)