コード例 #1
0
    def __init__(self, user_info: dict, user_name: str, direction: str = None):
        """
        Class to control the main game window

        :param user_info: User information for the current user
        :param user_name: Username of the current user
        :param direction: The direction the player is travelling in, if any
        """
        # Bot variables
        self.user_info = user_info
        self.user_name = user_name
        self.window_name = 'Main'
        self.reactions = ['east', 'north', 'south', 'west', 'reset']

        # Travel variables
        self.embed = None
        self.direction = direction
        self.image = None
        self.location_description = None
        self.location_updated = False
        self.location_x = None
        self.location_y = None
        self.original_x = None
        self.original_y = None
        self.world_map = None

        # AWS connection for uploading the game screen
        self.aws = aws.AWSHandler()
        self.image_url = 'https://discordgamebotimages.s3.us-east-2.amazonaws.com/'

        # Messages the bot should display
        self.messages = {'info': [], 'error': []}
コード例 #2
0
    def __init__(self):
        # Populated from discord
        self.all_user_info = None
        self.user_name = None
        self.user_id = None
        self.user_object = None
        self.bot = None

        # SQL variables
        self.connection = sqlite3.connect("../extra_files/serverDatabase.db")
        self.cursor = self.connection.cursor()

        # AWS connection for uploading the game screen
        self.aws = aws.AWSHandler()

        # Messages the bot should display
        self.messages = {'info': [], 'error': []}
コード例 #3
0
    def __init__(self, user_info: dict, user_name: str, direction: str = None):
        """
        Class to control the inventory window

        :param user_info: User information for the current user
        :param user_name: Username of the current user
        :param direction: The direction the player is travelling in, if any
        """
        self.user_info = user_info
        self.user_name = user_name
        self.window_name = 'Inventory'
        self.reactions = ['east', 'north', 'south', 'west']

        # Inventory variables
        self.embed = None
        self.highlight_moved = False
        self.direction = direction

        # AWS connection for uploading the game screen
        self.aws = aws.AWSHandler()
        self.image_url = 'https://discordgamebotimages.s3.us-east-2.amazonaws.com/'

        # Messages the bot should display
        self.messages = {'info': [], 'error': []}
コード例 #4
0
 def save_image(self):
     """
     Save the image as the given file name
     """
     self.table_to_image.img.save(self.file_name)
     aws.AWSHandler().upload_image(self.file_name)
コード例 #5
0
 def __init__(self):
     self.user_info = None
     self.user = None
     self.aws = aws.AWSHandler()