Exemplo n.º 1
0
    async def import_sheet(self, ctx, url: str, *args):
        """
        Loads a character sheet from one of the accepted sites:
            [D&D Beyond](https://www.dndbeyond.com/)
            [Dicecloud](https://dicecloud.com/)
            [GSheet v2.1](https://gsheet2.avrae.io) (auto)
            [GSheet v1.4](https://gsheet.avrae.io) (manual)
        
        __Valid Arguments__
        `-nocc` - Do not automatically create custom counters for class resources and features.
        `-noprep` - Import all known spells as prepared.

        __Sheet-specific Notes__
        D&D Beyond:
            Private sheets can be imported if you have linked your DDB and Discord accounts.  Otherwise, the sheet needs to be publicly shared.
            
        Dicecloud:
            Share your character with `avrae` on Dicecloud (edit permissions) for live updates.
        
        Gsheet:
            The sheet must be shared with directly with Avrae or be publicly viewable to anyone with the link.
            Avrae's google account is `[email protected]`.


        """  # noqa: E501
        url = await self._check_url(ctx, url)  # check for < >
        # Sheets in order: DDB, Dicecloud, Gsheet
        if beyond_match := DDB_URL_RE.match(url):
            loading = await ctx.send('Loading character data from Beyond...')
            prefix = 'beyond'
            url = beyond_match.group(1)
            parser = BeyondSheetParser(url)
Exemplo n.º 2
0
    async def beyond(self, ctx, url: str, *args):
        """
        Loads a character sheet from [D&D Beyond](https://www.dndbeyond.com/), resetting all settings.
        __Valid Arguments__
        `-nocc` - Do not automatically create custom counters for limited use features.
        """

        loading = await ctx.send('Loading character data from Beyond...')
        url = DDB_URL_RE.match(url)
        if url is None:
            return await loading.edit(content="This is not a D&D Beyond link.")
        url = url.group(1)

        override = await self._confirm_overwrite(ctx, f"beyond-{url}")
        if not override: return await ctx.send("Character overwrite unconfirmed. Aborting.")

        parser = BeyondSheetParser(url)
        await self._load_sheet(ctx, parser, args, loading)