Example #1
0
    async def start_game(self, message: Message, roleplay: str, players: str):
        config = State.get_config(message.guild.id)
        if config and 'rp' in config and config['rp']:
            await message.channel.send(
                f'Cannot start roleplay, {config["rp"]} is already in progress.'
            )
            return

        if roleplay not in self.bot.roleplays:
            await message.channel.send(
                f'Cannot start roleplay, unknown roleplay name {roleplay}'
            )
            return

        loading_message = await message.channel.send(f'Setting up new game...')
        config = {'rp': roleplay, 'connections': {}}
        await self.bot.save_guild_config(message.guild, config)
        await self.bot.refresh_from_config(message.guild, config, True)
        await message.author.add_roles(State.get_admin_role(message.guild.id))

        self.roleplay = self.bot.roleplays[roleplay]
        player_role = State.get_player_role(message.guild.id)
        for member in message.mentions:
            await member.add_roles(player_role)
        await self.move_force(message, self.roleplay.starting_room, None)

        await message.channel.send(f'The game begins.')
        await loading_message.delete()
        await message.delete()
Example #2
0
 async def mark_gm(self, message: Message, user: str):
     await self._mark_with_role(
         message, State.get_admin_role(message.guild.id), 'an admin'
     )