def get_amount_sat(self) -> Union[int, str, None]:
        """
        Returns an integer satoshi amount, or '!' or None.
        Callers who need msat precision should call get_amount_msat()
        """
        amount_msat = self.amount_msat
        if amount_msat in [None, "!"]:
            return amount_msat
        return int(amount_msat // 1000)

        Returns an integer satoshi amount, or '!' or None.
        Callers who need msat precision should call get_amount_msat()
        
electrum/invoices.py